Sum Problem (II) : Input/Output Pratice
Time Limit: 1 Sec Memory Limit: 2 MB
Submit: 540 Solved: 387
[Submit][Status][Web Board] Description
计算若干整数的和,这些整数都是小于1000的非负整数。
Input 输入的第一行是一个整数M,后面有M个测试样例。每个测试样例以一个整数N开始,后面接着是N个整数。
Output
每组测试样例对应一行输出,为所给的N个整数之和,顺序与输入对应。 Sample Input
2
3 1 2 3 5 10 15 20 30 50 Sample Output
6
125
HINT
用双重循环解决这个问题,外层循环控制用例的输入,内层循环控制读取N个整数。 Append Code
#include <stdio.h>
int main()
山东科技大学ojt题之Seq... 3页 免费山东科技大学...Sum Problem (III) : Input/Output Pratice Time Limit: 1 Sec Memory Limit...
山东科技大学ojt题之Sum Problem 隐藏>> Sum Problem Time Limit: 1 Sec Memory Limit: 2 MB Submit: 788 Solved: 395 [Submit][Status][Web Board] ...
山东科技大学ojt题之Sum Problem (IV) 隐藏>> Sum Problem (IV) : Input/Output Pratice Time Limit: 1 Sec Memory Limit: 2 MB Submit: 606 Solved: ...
山东科技大学ojt题之A+B Problem (IV)_工学_高等教育_教育专区。A+B ... 山东科技大学ojt题之Sum... 暂无评价 2页 免费 山东科技大学ojt题之Seq......
免费 山东科技大学ojt题之Sum P... 暂无评价 2页 免费喜欢此文档的还喜欢... Sequence Problem (II) : Array Pratice Time Limit: 1 Sec Memory Limit: ...
山东科技大学ojt题之A+B Problem_工学_高等教育_教育专区。A+B Problem Time... 山东科技大学ojt题之Sum... 暂无评价 2页 免费 山东科技大学ojt题之Seq......
免费 山东科技大学ojt题之Sum P... 暂无评价 2页 免费喜欢此文档的还喜欢... Matrix Problem (II) : Array Pratice Time Limit: 1 Sec Memory Limit: 4...
山东科技大学ojt题之Sum... 暂无评价 2页 免费 山东科技大学ojt题之Seq......A+B Problem (III) : Input/Output Pratice Time Limit: 1 Sec Memory ...
免费 山东科技大学ojt题之Sum P... 暂无评价 2页 免费喜欢此文档的还喜欢... Sequence Problem : Array Pratice Time Limit: 1 Sec Memory Limit: 4 MB ...
sum=0; scanf("%llu",&n); sum=n+n*(n-1)/2; printf("%llu",sum... 山东科技大学ojt题之平均... 山东科技大学ojt题之摄氏... 山东科技大学ojt题...
热门文档