上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 25 下一页
局部变量和全局变量的区别 局部变量可以与全局变量重名,但是局部变量会屏蔽全局变量。要使用全局变量,需要使用::。在函数体内引用变量会用到同名的局部变量而不是全局变量,对于一些编译器来说,在同一个函数体内可以定义多个同名的局部变量。例如我们可以在一个函数内部,在两个循环中都定义同名的局部变量i,而局部 Read More
posted @ 2017-08-22 19:17 A-inspire Views(7484) Comments(1) Diggs(2) Edit
总时间限制: 1000ms 内存限制: 65536kB描述Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 int n,m; char map[110][110]; int go[8][2]... Read More
posted @ 2017-08-22 18:26 A-inspire Views(178) Comments(0) Diggs(0) Edit
简单背包问题(0032) 简单背包问题(0032) 简单背包问题(0032) Time limit(ms): 1000 Memory limit(kb): 65535 Submission: 5657 Accepted: 1714 Accepted Time limit(ms): 1000 Memo Read More
posted @ 2017-08-22 18:09 A-inspire Views(223) Comments(0) Diggs(0) Edit
C/C++中的memset 1. 需要的头文件 C中为<memory.h> 或 <string.h> C++中为<cstring> 包含在 <string.h>头文件中memset为内存填充函数,可以用它对一片内存空间进行初始化, 它可以一字节一字节地把整个数组设置为一个指定的值其原型为void * Read More
posted @ 2017-08-22 17:32 A-inspire Views(194) Comments(0) Diggs(0) Edit
给定一个正整数序列,判断其中有多少个数,等于数列中其他两个数的和。 比如,对于数列1 2 3 4, 这个问题的答案就是2, 因为3 = 2 + 1, 4 = 1 + 3。 Read More
posted @ 2017-08-22 17:26 A-inspire Views(622) Comments(0) Diggs(0) Edit
4104:单词翻转 4104:单词翻转 总时间限制: 1000ms 内存限制: 65536kB描述 输入一个句子(一行),将句子中的每一个单词翻转后输出。 输入只有一行,为一个字符串,不超过500个字符。单词之间以空格隔开。输出翻转每一个单词后的字符串,单词之间的空格需与原文一致。样例输入 hell Read More
posted @ 2017-08-21 18:19 A-inspire Views(239) Comments(0) Diggs(0) Edit
A:分段函数 编写程序,计算下列分段函数y=f(x)的值。 y=-x+2.5; 0 <= x < 5 y=2-1.5(x-3)(x-3); 5 <= x < 10 y=x/2-1.5; 10 <= x < 20 Read More
posted @ 2017-08-21 17:21 A-inspire Views(500) Comments(0) Diggs(0) Edit
0:A+B Problem 0:A+B Problem 总时间限制: 1000ms 内存限制: 65536kB描述 Calculate a + b 输入Two integer a,,b (0 ≤ a,b ≤ 10)输出Output a + b样例输入 1 2 样例输出 3 #include <ios Read More
posted @ 2017-08-21 17:03 A-inspire Views(179) Comments(0) Diggs(0) Edit
2800:垂直直方图 2800:垂直直方图 总时间限制: 1000ms 内存限制: 65536kB描述 输入4行全部由大写字母组成的文本,输出一个垂直直方图,给出每个字符出现的次数。注意:只用输出字符的出现次数,不用输出空白字符,数字或者标点符号的输出次数。 输入输入包括4行由大写字母组成的文本,每 Read More
posted @ 2017-08-21 16:17 A-inspire Views(471) Comments(0) Diggs(0) Edit
2807:两倍 2807:两倍 总时间限制: 1000ms 内存限制: 65536kB描述 给定2到15个不同的正整数,你的任务是计算这些数里面有多少个数对满足:数对中一个数是另一个数的两倍。比如给定1 4 3 2 9 7 18 22,得到的答案是3,因为2是1的两倍,4是2个两倍,18是9的两倍。 Read More
posted @ 2017-08-18 18:56 A-inspire Views(445) Comments(0) Diggs(0) Edit
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 25 下一页