武汉科技大学ACM :1001: A + B Problem
2024-08-28 08:55:04
Problem Description
Calculate A + B.
Input
Each line will contain two integers A and B. Process to end of file.
Output
For each case, output A + B in one line.
Sample Input
1 1
2 2
3 3
Sample Output
2
4
6
我的代码:
#include <stdio.h>
int main()
{
int A,B,sum;
while(scanf("%d%d",&A,&B) != EOF) {
sum=A+B;
printf("%d\n",sum);
}
return ;
}
其他代码:
#include<stdio.h>
int main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n",a + b);
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
scanf("%d%d", &a, &b);
printf("%d", a + b);
return ;
}
#include <iostream> using namespace std; int main()
{
int a=,b=;
while(cin>>a>>b)
{
cout<<a+b<<endl; } return ;
}
最新文章
- MJPhotoBrowser BUG修复
- bootstrap源码分析之tab(选项卡)
- shell变量判空几种方法
- Berkeley 四种产品如何选择?
- apache 2.4 针对某个文件限速
- Middleware
- HDOJ(HDU) 2083 简易版之最短距离(中位数)
- 浅谈ThreadPool 线程池
- 设计模式多线程方面之Thread-Per-Message 模式
- UVALive 6584 Escape (Regionals 2013 >;>; Europe - Central)
- Q &; A
- Android动态加载入坑指南
- 【转载】Sqlserver数据库备份的几种方式
- [Codeforces Round #516][Codeforces 1063B/1064D. Labyrinth]
- 【Python】随机数random模块randint、shuffle、random、sample、choice、uniform、
- Painter&#39;s Problem (高斯消元)
- maven安装操作
- C++学习(二十一)(C语言部分)之 函数2
- iOS中的MVC
- WebLogic 12c 修改节点 Managed Server 和 AdminServer 内存方法
热门文章
- Python实现类似switch...case功能
- 《python基础教程》笔记之 其它语句1
- Altium 9中正确的差分对走线方法
- keil #pragma disable
- Xamarin devexpress datagrid 样式
- Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
- java中jsoup框架解析html
- 计蒜客 444 / xtuoj 1024 京东的物流路径(并查集+离线lca)或者 (点分治)
- guestfish 修改 image file
- go语言的安装和配置,以及包引用