A + B Problem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 571020    Accepted Submission(s):
181151

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
  1. #include <iostream>
  2. #include <cstdio>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a=,b=;
  9. while(scanf("%d %d",&a,&b)!=EOF){
  10. printf("%d\n",a+b);
  11. }
  12. return ;
  13. }

Sum Problem

Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 410639    Accepted Submission(s):
103262

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

  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int t;
  8. int sum=;
  9. while(scanf("%d",&t)!=EOF){
  10. for(int i=;i<=t;i++){
  11. sum+=i;
  12. }
  13. printf("%d\n\n",sum);
  14. sum=;
  15. }
  16. return ;
  17. }

字符串连接:

  1. #include <iostream>
  2. #include <cstdio>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. char a[]="i love";
  9. char b[]="you!";
  10. char c[];
  11. sprintf(c,"%s %s",a,b);
  12. printf("%s",c);
  13. return ;
  14. }

HDU 1000 & HDU1001 & 字符串连接的更多相关文章

  1. hdu 1000&hdu1001

    1001 #include<iostream> #include<stdio.h> using namespace std; int main() { long long n; ...

  2. hdu 5510 Bazinga(字符串kmp)

    Bazinga Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Sub ...

  3. ytu 1052: 写一函数,将两个字符串连接(水题,指针练习)

    1052: 写一函数,将两个字符串连接 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 343  Solved: 210[Submit][Status][ ...

  4. 关于python字符串连接的操作

    python字符串连接的N种方式 注:本文转自http://www.cnblogs.com/dream397/p/3925436.html 这是一篇不错的文章 故转 python中有很多字符串连接方式 ...

  5. js ES6 多行字符串 连接字符串

    1. 以前,js多行字符串用\n写起来比较费事,所以最新的ES6标准新增了一种多行字符串的表示方法,用` ... `表示: 旧版写法 alert("你好,\n 我叫\n Olive" ...

  6. python字符串连接的N种方式

    python中有很多字符串连接方式,今天在写代码,顺便总结一下: 最原始的字符串连接方式:str1 + str2 python 新字符串连接语法:str1, str2 奇怪的字符串方式:str1 st ...

  7. SQL注入的字符串连接函数

    在select数据时,我们往往需要将数据进行连接后进行回显.很多的时候想将多个数据或者多行数据进行输出的时候,需要使用字符串连接函数.在sqli中,常见的字符串连接函数有concat(),group_ ...

  8. Swift语言—有趣的字符串连接、数组、字典

    字符串链接:Swift语言中的字符串连接方式本人觉得非常的有趣,变量连接需要用右斜杠,并且变量名要括起来 “\(变量名)”,后面的字符串连接分别用逗号 ‘ , ’ 隔开 数组: Var arr = [ ...

  9. python 字符串连接

    字符串连接 方法1: 用字符串的join方法 a = ['a','b','c','d']content = ''content = ''.join(a)print content 方法2: 用字符串的 ...

随机推荐

  1. vim基础命令

    2015-06-04 by komilevim基础命令 打开一个文件 vim index.php 几种模式说明Normal Mode也就是最一般的普通模式,默认进入vim之后,处于这种模式.Inser ...

  2. iOS之下拉放大,上推缩小,一个方法搞定

    先来看看效果吧. 讲讲大概的实现思路:1、创建头部的视图和tableview,需要注意的是tableview要设置contentInset,contentInsent 的顶部要和头部视图的背景图的高度 ...

  3. APPCAN MAS接口之AJAX

    1.打开APPCAN IDE,文件→新建→MAS服务 2.新建MAS项目 3.新建MAS接口,访问地址http://mobile.163.com/special/chuangye/ 4.修改if_cy ...

  4. 如何让JQuery报错-遁地龙卷风

    0.解决的问题 a.当选择器语法没有问题,找不到元素时,让jquery报错 b.选择器语法有问题,程序无法继续执行时,让jquery报错 主要针对传递字符串,尝试前请备份jquery库,最好改变名字加 ...

  5. MongoDB的安全(五)

    MongoDB用户管理操作: MongoDB开启权限认证的方式有两种一种是auth形式,一种是keyfile形式 MongoDB创建用户: 1. 创建用户语法:在MongoDB2.6版本之后使用cre ...

  6. Eclipse高级使用技巧

    1. Eclipse的配置文件导入和导出功能 说明:可以将Eclipse的自定义的工作空间配置文件导出和导入,这样创建多工作空间时候就省去了再设置的烦恼. 2. Eclipse设置显示行号 说明:设置 ...

  7. #Deep Learning回顾#之基于深度学习的目标检测(阅读小结)

    原文链接:https://www.52ml.net/20287.html 这篇博文主要讲了深度学习在目标检测中的发展. 博文首先介绍了传统的目标检测算法过程: 传统的目标检测一般使用滑动窗口的框架,主 ...

  8. Graphic32中TBitmap32.TextOut性能分析[转载]

    转载:http://blog.csdn.net/avan_lau/article/details/6958497 最近在分析软件中画线效率问题,发现在画一些标志性符号的方法,存在瓶颈,占用较大的时间. ...

  9. PHP开发神器——phpstorm

    常用快捷键 快捷键 说明 ctrl+j 插入活动代码提示 ctrl+alt+t 当前位置插入环绕代码 alt+insert 生成代码菜单 Shift + Enter 新一行 ctrl+q 查看代码注释 ...

  10. 17.2---#字棋(CC150)

    牛客网的在线题.思路,比较简单.就是判断一下是否有连起来的1. public static boolean checkWon(int[][] board){ boolean res = false; ...