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 ...
随机推荐
- C# -- 使用Aspose.Cells创建和读取Excel文件
使用Aspose.Cells创建和读取Excel文件 1. 创建Excel Aspose.Cells.License li = new Aspose.Cells.License(); li.SetLi ...
- 023合并K个链表并排序
#include "000库函数.h" struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), n ...
- C语言入坑指南-被遗忘的初始化
前言 什么是初始化?为什么要初始化?静态变量和局部变量的初始化又有什么区别?实际应用中应该怎么做?本文将一一回答这些问题. 什么是初始化 初始化指的是对数据对象或者变量赋予初始值.例如: int va ...
- 一文读懂SpringCloud与Eureka,Feign,Ribbon,Hystrix,Zuul核心组件间的关系
概述 毫无疑问,Spring Cloud是目前微服务架构领域的翘楚,无数的书籍博客都在讲解这个技术.不过大多数讲解还停留在对Spring Cloud功能使用的层面,其底层的很多原理,很多人可能并不知晓 ...
- java继承-super的用法
继承的特点: 1.子类继承了父类的成员 2.具有层次结构 继承的优点: 1.代码重用 2.父类字段和方法可用于子类 3.从抽象到具体形成类的继承体系 4.可以轻松自定义子类 this:当前对象的引用 ...
- CSS--position:relative和position:absolute
position:relative相对定位 1. 如何定位?每个元素在页面的普通流中会“占有”一个位置,这个位置可以理解为默认值,而相对定位就是将元素偏离元素的默认位置,但普通流中依然保持着原有的默认 ...
- 004_Python之all()\any()
http://www.jianshu.com/p/65b6b4a62071 一.待验证整理
- 环境部署(五):Linux下安装Gradle
Gradle是一个基于Apache的Ant和Maven的项目自动化构建工具,相比于Ant和Maven的局限性,Gradle可以更好的帮助管理项目中的差异.依赖.编译.打包.部署. 可以自定义满足自己需 ...
- OGC标准服务 WMS WCS WFS WPS
网络覆盖服务 (WCS) 网络要素服务 (WFS) 网络地图服务 (WMS) 网络地图切片服务 (WMTS) 网络处理服务 (WPS) 1.Web 地图服务(WMS)能够根据用户的请求返回相应的地图( ...
- odoo10学习笔记
odoo的API: Odoo新API的介绍与应用: odoo新api的实现是借助于python装饰器.新API的装饰器主要有以下几种: model,multi,one,constrains,depen ...