码迷,mamicode.com
首页 >  
搜索关键字:int-max    ( 1549个结果
Java 通过Math.random() 生成6位随机数
1 public static void main(String[] args) { 2 String sjs=""; 3 4 for (int i = 0; i < 6; i++) { 5 int max=9,min=0; 6 int ran2 = (int) (Math.random... ...
分类:编程语言   时间:2019-10-31 16:23:09    阅读次数:308
【每天一题】LeetCode 172. 阶乘后的零
开源地址: "点击该链接" 题目描述 示例代码 c++ class Solution { public: int trailingZeroes(int n) { int max_exp = log(n) / log(5); int res = 0; for (int i=0; i ...
分类:其他好文   时间:2019-10-25 20:38:07    阅读次数:85
题解 CF1203D2 【Remove the Substring (hard version)】
"题目链接" Solution CF1203D 题目大意:给定两个字符串$s$,$t$, $t$是$s$的子序列,问最长可以在$s$里面删掉多长的连续子序列使得$t$仍为$s$的子序列 贪心 分析: 假如我们$t$的一个前缀要匹配$s$的话,显然尽可能往前匹配,这样可以使得答案尽量大,后缀同理 我们 ...
分类:其他好文   时间:2019-10-25 13:31:38    阅读次数:80
java-面向对象-静态的应用
/* 静态的应用 每一个应用程序中都有共性的功能, 可以将这些功能进行抽取,能独立封装, 以便复用 */ class Demo { public static void main(String[] args) { int[] arr = (2,4,1,8); int max = getMax(arr ...
分类:编程语言   时间:2019-10-24 13:29:53    阅读次数:78
C语言中,关于排序的问题(输入n个数,输出最大的那个)
int n,max=0,t; scanf("%d",&n); int a[n],i,k; //这个a[n]必须要在输入n的值之后才能定义,不然定义不成。 for(i=1;i<=n;i++) a[i]=0; //申请n个值 for(k=1;k<=n;k++) { scanf("%d",&t); a[k ...
分类:编程语言   时间:2019-10-23 11:29:17    阅读次数:132
最大子数组之和
#include<stdio.h> #include<stdlib.h>int main(){ int n, i; int num[1000]; int sum = 0; int max = 0; scanf_s("%d\n", &n); for (i = 0; i < n; i++) { scan ...
分类:编程语言   时间:2019-10-22 00:44:01    阅读次数:72
生成树计数 lighting 最终决定用这个模板!
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #include <cmath> 5 #define sqr(x) ((x)*(x)) 6 using namespace std; 7 const int M=100... ...
分类:其他好文   时间:2019-10-19 14:38:36    阅读次数:71
求多个数中最大值
public class demo08 { public static void main(String[] args) { int a = 20, b = 30, c = 40; int d = (a>b) ? 20 : 30; int max = (d>c) ? 30 : 40; System. ...
分类:其他好文   时间:2019-10-13 15:28:10    阅读次数:58
SGI-STL简记(五)-工具、杂项解析
utility: stl_relops.h : 内部提供了重载模板operator!=、operator>、operator=,而这几个模板函数内部使用到了operator==以及operator其中T*为 申请到的空间地址,第二个参数为实际分配到的空间大小;最大可申请大小为INT_MAX / si... ...
分类:其他好文   时间:2019-10-10 12:58:02    阅读次数:93
函数基础二
函数的使用原则函数的使用应该分为两个明确的阶段1.定义阶段:(定义一个函数)不会执行函数体代码 会检测语法def func(): print('from func') 2,调用阶段:会触发函数体代码的执行func() 先定义后调用:def bar(): print('from bar')def fo ...
分类:其他好文   时间:2019-10-05 00:30:23    阅读次数:100
1549条   上一页 1 ... 14 15 16 17 18 ... 155 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!