码迷,mamicode.com
首页 >  
搜索关键字:int-max    ( 1549个结果
最大数和最小数
最大数#include <stdio.h>#define MAX 10int main() { int n, a[MAX]; printf("Input the number of figure(<10):\n"); scanf("%d",&n); for (int i = 0; i < n; i+ ...
分类:其他好文   时间:2020-05-04 15:48:54    阅读次数:172
累加和累乘
累加#include <stdio.h>#define MAX 10int main() { int n; int a[MAX]; int sum = 0; printf("Input the number of figure(<=10):\n"); scanf("%d",&n); for(int ...
分类:其他好文   时间:2020-05-04 15:26:15    阅读次数:73
[pointer]调用函数找出一维数组中的最值,
#include <stdio.h> void minmax(int a[], int *min, int *max, int len); //函数声明 int main() { int b[] = {1, 2, 4, 7, 10, 15, 17, 20, 100, 90, -1, 1000, 20 ...
分类:编程语言   时间:2020-04-30 22:50:31    阅读次数:58
大数计算求(3^n+1)/2
#include <iostream> #include <vector> using namespace std; const int MAX_LEN = 10000; int main() { int n = 0; //3^n的最大位数是:10000,乘一次3就加一位 while (cin >> ...
分类:其他好文   时间:2020-04-25 01:05:33    阅读次数:69
求两个数最大值
/* time:2020年4月24日19:31:51 where:gfdx function:比较最大值*/ #include <stdio.h> int max(int a, int b); int main() { int a, b;//定义变量 scanf_s("%d %d", &a, &b) ...
分类:其他好文   时间:2020-04-24 19:49:37    阅读次数:60
n皇后问题 非递归解法1
运行结果: 代码如下: 1 #include <bits/stdc++.h> 2 using namespace std; 3 #include <bits/stdc++.h> 4 using namespace std; 5 const int MAX = 1024; 6 const char * ...
分类:其他好文   时间:2020-04-19 00:50:47    阅读次数:48
acwing_01背包
#include <iostream>#include <algorithm>using namespace std;const int MAX=1010;int f[MAX][MAX];//表示装了前i个背包后的最大价值是多少int v[MAX],w[MAX];int main(){ int n, ...
分类:Windows程序   时间:2020-04-13 00:46:03    阅读次数:80
一道很简单的题目--不同的写法
写这道题目的意图呢是简单的总结下链表的使用,还有注意的事情 First 比较简单的写法,直接比较大小,不保存数据 int main() { int max = 0, sou; while (1) { printf("输入成绩\n"); scanf("%d", &sou); if (max < sou ...
分类:其他好文   时间:2020-04-06 23:48:02    阅读次数:124
C++——函数(二)
函数的重载 看下面的max函数 //返回两数间的最大值 int max (int num1, int num2) {//比较num1和num2 if (num1 >= num2) { return num1; } else { return num2; } } 如果我们想要比较两个浮点数的最大值,那 ...
分类:编程语言   时间:2020-04-06 14:00:26    阅读次数:70
生产者消费者模式
public class Storage{ // 仓库最大存储量 private final int MAX_SIZE = 100; // 仓库存储的载体 private LinkedList<Object> list = new LinkedList<Object>(); // 生产产品 publ ...
分类:其他好文   时间:2020-04-04 22:38:56    阅读次数:78
1549条   上一页 1 ... 5 6 7 8 9 ... 155 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!