我的代码游记

首页

关于

归档

杭电HDU

1001.Sum Problem

Problem Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + … + n.计算1 + 2 + 3 + …… + n的值InputThe input will consist of a series of integers n, one integer per line.OutputFor each case, output SUM(n) in one line, followed by a blank line. You may assume the result w..

更多
杭电HDU

1000.A + B Problem

Problem Problem DescriptionCalculate A + B计算A+B的值InputEach line will contain two integers A and B. Process to end of file.每行将会包括两个整数A和B,直到文件结束OutputFor each case, output A + B in one line.对于每一个样例,在另起一行输出A + BSample Input1 1Sample Output2 Solution  这是我在杭电上刷的第一道题,和leetcode等平台不一样的是,杭电的OJ需要自己写输入函数,这就意味着输入格式也是考察的一个方面,这曾经是无数坑的开端,包括曾经不懂Process to end of file就是..

更多
1222324