- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
整理出ACM所有题目及答案整理出ACM所有题目及答案整理出ACM所有题目及答案
Word可编辑
1000 A + B Problem
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?
Sample Output
2?
Author
HDOJ
代码:
#includestdio.h
int main()
{
int a,b;
while(scanf(%d %d,a,b)!=EOF)
printf(%d\n,a+b);
}
1001 Sum Problem
Problem Description
Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.
?
Input
The input will consist of a series of integers n, one integer per line.
?
Output
For each case, output SUM(n) in one line, followed by a blank line. You may assume the result will be in the range of 32-bit signed integer.?
Sample Input
1
100
?
Sample Output
1
5050?
Author
DOOM III
解答:
#includestdio.h
main()
{
int n,i,sum;
sum=0;
while((scanf(%d,n)!=-1))
{
sum=0;
for(i=0;i=n;i++)
sum+=i;
printf(%d\n\n,sum);
}
}
1002 A + B Problem II
Problem Description
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.
?
Input
The first line of the input contains an integer T(1=T=20) which means the number of test cases. Then T lines follow, each line consists of two positive integers, A and B. Notice that the integers are very large, that means you should not process them by using 32-bit integer. You may assume the length of each integer will not exceed 1000.?
Output
For each test case, you should output two lines. The first line is Case #:, # means the number of the test case. The second line is the an equation A + B = Sum, Sum means the result of A + B. Note there are some spaces int the equation. Output a blank line between two test cases.
?
Sample Input
2
1 2
?
Sample Output
Case 1:
1 + 2 = 3
Case 2:
?
Author
?
代码:
#include stdio.h
#include string.h
int main(){
char str1[1001], str2[1001];
int t, i, len_str1, len_str2, len_max, num = 1, k;
您可能关注的文档
- 公司招聘笔试题目思维测试题.doc
- 公司招聘笔试题目心理测验.doc
- 其他项目工作底稿目录.doc
- 强企业必修课销售学教程.doc
- 体系记录范本表格部门培训申请表.doc
- 舞弊风险评估与应对.doc
- 业务完成阶段工作底稿.doc
- 幼儿园中班教育教学工作计划.doc
- 幼儿园主题计划.doc
- 鱼类学习题及答案.doc
- 湖南省衡阳市第八中学2026届高三上学期第一次月考物理(原卷版).doc
- 浙江省普通高中尖峰联盟2026届高三上学期10月联考英语(原卷版).doc
- 四川省绵阳市南山中学实验学校2026届高三上学期10月月考英语(原卷版).doc
- 湖南省衡阳市第八中学2026届高三上学期第二次月考历史 Word版含解析.doc
- 福建中考物理5年(2021-2025)真题分类汇编:专题09 功和机械能(原卷版).doc
- 福建中考物理5年(2021-2025)真题分类汇编:专题10 内能及其利用(原卷版).doc
- 福建中考物理5年(2021-2025)真题分类汇编:专题07 压强(原卷版).doc
- 福建中考物理5年(2021-2025)真题分类汇编:专题01 机械运动(原卷版).doc
- 福建中考物理5年(2021-2025)真题分类汇编:专题02 声现象(解析版).doc
- 福建中考物理5年(2021-2025)真题分类汇编:专题02 声现象(原卷版).doc
最近下载
- 2024年全球及中国天然超氧化物歧化酶行业头部企业市场占有率及排名调研报告.docx
- 初中英语固定搭配大全.pdf VIP
- 电力系统500kV串补保护的配置及动作逻辑原理详解培训.pptx VIP
- DB42_T 268-2012 蒸压加气混凝土砌块工程技术规程.docx
- 机电设备安装与维修专业人才培养方案.docx VIP
- 成人外周动脉导管留置与维护.pdf VIP
- 四宫格四阶数独学习材料包(完整版)-附带讲解和练习-适合零基础.pdf VIP
- 220kV升压站SVG设备安装.docx VIP
- 汽车灯光系统检修教学能力比赛教案.pdf
- 2023水电工程地下建筑物安全监测技术规范.docx VIP
原创力文档


文档评论(0)