HDU 1089 到1096 a+b的输入输出练习
http://acm.hdu.edu.cn/showproblem.php?pid=1089
Too easy?! Of course! I specially designed the problem for acm beginners.
You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.
10 20
#include <iostream> using namespace std; int main()
{
int a,b;
int sum=0;
while(cin>>a>>b)
{
sum=a+b;
cout<<sum<<endl;
}
return 0;
}
30
#include <iostream> using namespace std; int main()
{
int T;
cin >> T;
int sum=0;
for(int i = 1;i <= T;i ++)
{
int a,b;
cin>>a>>b;
sum=a+b;
cout<<sum<<endl;
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=1091
10 20
0 0
30
#include <iostream> using namespace std; int main()
{
int a,b;
int sum = 0;
while(cin >> a >> b)
{
if(a == 0 && b == 0)
break;
else
sum = a + b;
cout << sum << endl;
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=1092
5 1 2 3 4 5
0
15
#include <iostream> using namespace std; int main()
{
int n;
while(cin>>n)
{
if(n==0)
break;
int sum=0;
for(int i=1; i<=n; i++)
{
int x;
cin>>x;
sum+=x;
}
cout<<sum<<endl;
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=1093
4 1 2 3 4
5 1 2 3 4 5
15
#include <bits/stdc++.h> using namespace std; int main()
{
int N,M;
cin >> N; for(int i=1;i<=N;i++)
{
int sum=0;
cin>>M;
for(int j=1;j<=M;j++)
{
int x;
cin>>x;
sum+=x;
}
cout<<sum<<endl;
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=1094
5 1 2 3 4 5
15
#include <bits/stdc++.h> using namespace std; int main()
{
int N;
while(scanf("%d",&N)!=EOF)
{
int sum=0;
for(int i=1;i<=N;i++)
{
int x;
cin>>x;
sum+=x;
}
cout<<sum<<endl;
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=1095
10 20
30
#include <bits/stdc++.h> using namespace std; int main()
{
int a,b;
int sum=0;
while(cin>>a>>b)
{
sum=a+b;
cout<<sum<<endl<<endl;
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=1096
4 1 2 3 4
5 1 2 3 4 5
3 1 2 3
15
6
#include <bits/stdc++.h> using namespace std; int main()
{
int N,M;
cin>>N;
for(int i=1;i<=N;i++)
{
int sum=0;
cin>>M;
for(int j=1;j<=M;j++)
{
int x;
cin>>x;
sum+=x;
}
if(N!=i)
cout<<sum<<endl<<endl;
else
cout<<sum<<endl;
}
return 0;
}
HDU 1089 到1096 a+b的输入输出练习的更多相关文章
- C++ 的简单输出输入 HDU 1089~1096
A+B for Input-Output Practice (I) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K ...
- HDU 1089 A+B for Input-Output Practice (I)
#include <cstdio> int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF) prin ...
- HDU题解索引
HDU 1000 A + B Problem I/O HDU 1001 Sum Problem 数学 HDU 1002 A + B Problem II 高精度加法 HDU 1003 Maxsu ...
- 小C的故事(快速学C语言,,,极速版!)
前几天这篇博客写了太多废话! 删啦~~. 本篇博客只是为chd A协的全嫩小鲜肉入门C语言的预科, 如果你在此处学习C语言, 不幸走火入魔, 小弱概不负责. //请直接随便找个C语言编译器,抄一下下面 ...
- 网络爬虫 - 真·AC自动机
前几天无聊,忽然想写点有趣的代码,关于网络方面的,刚开始就想写一个能从oj上自动拉个比赛的软件,后来查资料时看到了神奇的AC自动机,于是自己也去实现了遍. 一天狂A 500多道...就当自娱自乐了.在 ...
- 2道acm编程题(2014):1.编写一个浏览器输入输出(hdu acm1088);2.encoding(hdu1020)
//1088(参考博客:http://blog.csdn.net/libin56842/article/details/8950688)//1.编写一个浏览器输入输出(hdu acm1088)://思 ...
- HDU 2993 MAX Average Problem(斜率DP经典+输入输出外挂)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2993 题目大意:给出n,k,给定一个长度为n的序列,从其中找连续的长度大于等于k的子序列使得子序列中的 ...
- hdu(杭电oj)输入输出练习题目总结
1000.1001 .1089.1090.1091.1092.1093.1094.1095.1096
- hdu 1426(DFS+坑爹的输入输出)
Sudoku Killer Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
随机推荐
- LeetCode算法题-Third Maximum Number(Java实现-四种解法)
这是悦乐书的第222次更新,第235篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第89题(顺位题号是414).给定非空的整数数组,返回此数组中的第三个最大数字.如果不存 ...
- Java面试知识点之计算机网络篇(一)
前言:在Java面试中,计算机网络的知识也是一项重点,因此笔者在此对计算机网络的相关知识进行总结. 1.OSI参考模型 自下而上:物理层(物理介质,比特流).数据链路层(网卡.交换机).网络层(IP协 ...
- uva 11728 - Alternate Task(数论)
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u011328934/article/details/36409469 option=com_onli ...
- 转://云和恩墨的两道Oracle面试题
真题1. 对于一个NUMBER(1)的列,如果查询中的WHERE条件分别是大于3和大于等于4,那么这二者是否等价? 答案:首先对于查询结果而言,二者没有任何区别.从这一点上讲无论是指定大于3还是指定大 ...
- 1-tomcat简介
一.tomcate的目录结构说明: 1.bin:存放服务器启动和关闭的命令文件.2.conf:存放服务器的配置信息文件3.lib:存放服务器自身需要的所有jar文件,也称为全局jar文件(只要部署在当 ...
- Arduino 操作OLED
https://item.taobao.com/item.htm?_u=n1qf7bf5beef&id=562158712128 1.模块尺寸:35(L)*31(W)mm 2.电源电压:2.8 ...
- ESP8266 mDNS
https://circuits4you.com/2017/12/31/esp8266-mdns/ 本教程介绍如何使用ESP8266进行多播DNS?在网络世界中,很难记住每个网站和计算机的IP地址,解 ...
- @ConfigurationProperties 配置详解
文章转自 https://blog.csdn.net/qq_26000415/article/details/78942494 前言新的一年到了,在这里先祝大家新年快乐.我们在上一篇spring bo ...
- [Micropython] TPYBoard STM32F407开发板运行第一个脚本
从这篇教程开始将动手在TPYBoard STM32F407开发板上运行 Python 脚本,下面教大家拿到这个开发板后怎么用!(该款开发板某宝上有售) 1 连接开发板 通过 USB 线连接你的 PC ...
- 洛谷 P1605 迷宫
题目链接 https://www.luogu.org/problemnew/show/P1605 题目背景 迷宫 题目描述 给定一个N*M方格的迷宫,迷宫里有T处障碍,障碍处不可通过.给定起点坐标和 ...