输入输出知识总结
来源:互联网 发布:金融网络销售工作内容 编辑:程序博客网 时间:2024/06/02 19:42
Sample Input
1 5
10 20
Sample Output
6
30
2
1 5
10 20
Sample Output
6
30
1 5
10 20
0 0
Sample Output
6
30
4 1 2 3 4
5 1 2 3 4 5
0
Sample Output
10
15
2
4 1 2 3 4
5 1 2 3 4 5
Sample Output
10
15
4 1 2 3 4
5 1 2 3 4 5
Sample Output
10
15
1 5
10 20
Sample Output
6
30
1 5
10 20
Sample Output
6
30
#include<stdio.h>int main(){ int m,n; while(2==scanf("%d%d",&m,&n)) { printf("%d\n",m+n); } return 0;}Sample Input
2
1 5
10 20
Sample Output
6
30
#include<stdio.h>int main(){ int n; scanf("%d",&n); while(n--) { int m,n; scanf("%d%d",&m,&n); printf("%d\n",m+n); } return 0;}Sample Input
1 5
10 20
0 0
Sample Output
6
30
#include<stdio.h>int main(){ int a,b; while(2==scanf("%d%d",&a,&b)&&(a||b)) { printf("%d\n",a+b); } return 0;}Sample Input
4 1 2 3 4
5 1 2 3 4 5
0
Sample Output
10
15
#include<stdio.h>int main(){ int N; while(1==scanf("%d",&N)&&N) { int a,sum=0; while(N--) { scanf("%d",&a); sum+=a; } printf("%d\n",sum); } return 0;}Sample Input
2
4 1 2 3 4
5 1 2 3 4 5
Sample Output
10
15
#include<stdio.h>int main(){ int N; scanf("%d",&N); while(N--) { int sum=0,m,a; scanf("%d",&m); while(m--) { scanf("%d",&a); sum+=a; } printf("%d\n",sum); } return 0;}Sample Input
4 1 2 3 4
5 1 2 3 4 5
Sample Output
10
15
#include<stdio.h>int main(){ int m,a; while(1==scanf("%d",&m)) { int sum=0; while(m--) { scanf("%d",&a); sum+=a; } printf("%d\n",sum); } return 0;}Sample Input
1 5
10 20
Sample Output
6
30
#include<stdio.h>int main(){ int a,b; while(2==scanf("%d%d",&a,&b)) { printf("%d\n",a+b); putchar('\n'); } return 0;}
0 0
- 输入输出知识总结
- JAVA知识专题总结之输入输出
- 输入输出总结
- 计算机系统知识--输入输出技术
- java中输入输出流的知识总结 以及小例子程序
- C语言输入输出总结
- C语言输入输出总结
- C语言输入输出总结
- C语言输入输出总结
- 一些输入输出总结
- JAVA中输入输出总结
- C++输入输出流总结
- Java输入输出学习总结
- C语言输入输出总结
- Java 输入输出流总结
- 【总结】输入输出技巧
- c/c++输入输出总结
- C输入输出总结
- 《程序员必读的职业规划书》@Easy 阅读反馈
- lintcode:Sliding Window Maximum
- 结构体对齐规则
- hibernate相关异常
- JS实现的给中排序算法
- 输入输出知识总结
- 使用绑定服务实现一个简单的音乐播放器
- Geogebra下载【linux,MacOS,windows,iOS, Android】
- testng 2 基本注解(注释)
- 开博笑话
- 递归取得当前节点下所有子节点
- 字集打印0.0
- CocoaPods详解之-Podfile.lock
- 北大ACM校赛C15I:The New MindSwitcher