- 博客(6)
- 收藏
- 关注
转载 1003 自己的第一版修改以后
//对于楼主的原代码,用如下数据进行测试: //1 //10 -5 -6 3 2 1 -7 6 3 -10 8 //Case 1: //9 3 8 (楼主原代码的输出,有误) 正确的应该是9 7 8 //楼主的原代码,能计算出最大值,能定出k_end, //但是,不能定出正确的k_start //修改楼主的代码,让其能定出正确的k_start. // //如果没有限制程序的大小,改
2017-04-17 11:26:36 324
原创 1004 Let the Balloon Rise
#include<iostream> #include<string>using namespace std;int main() { while (1) { char color[1000][15];//注意是全局变量还是局部变量 int count[1000] = { 0 };//注意是全局变量还是局部变量 int color_
2017-04-16 18:54:15 162
原创 1003 Max Sum
#include<iostream>using namespace std;int main() { int test, num; int a[100000]; cin >> test; if (test >= 1 && test <= 20) { for (int i = 0; i < test; i++)
2017-04-16 18:16:54 173
原创 1002 A + B Problem II
#include<iostream> #include<string>using namespace std;/* 一定不要这么写,因为没有把值传回去 void max_L(string a, string b) { string c; if (a.length() < b.length()) { c = a; a = b; b = c; } } */int main() { int tes
2017-04-16 16:36:24 156
原创 1001 Sum Problem
#include<iostream>using namespace std;int main() { int n, sum;//sum=(1+n)*n/2,但是如果直接么写,会出错,题目要求了32位带符号整数,很可能会超出范围 while (cin >> n) { if (n % 2 == 0) { sum = n /
2017-04-16 15:18:51 146
原创 1000 A+B Problem
第一次刷题写博客。scanf_s("%d%d", &a, &b); /*1、正整数,表示正确输入参数的个数,左边例子是2 2、0,表示用户的输入不匹配,无法正确输入任何值 3、 EOF,这是在stdio.h里面定义的常量(通常值为-1),表示输入流已经结束。在Windows下,用户按下CTRL+Z(会看到一个^Z字符)再按下回车(可能需要重复2次),就表示输入结束;L
2017-04-16 15:07:10 237
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人