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
#include <iostream>
#include <cstdio> using namespace std; int main()
{
int a=,b=;
while(scanf("%d %d",&a,&b)!=EOF){
printf("%d\n",a+b);
}
return ;
}

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

#include <iostream>
#include <cstdio>
using namespace std; int main()
{
int t;
int sum=;
while(scanf("%d",&t)!=EOF){
for(int i=;i<=t;i++){
sum+=i;
}
printf("%d\n\n",sum);
sum=;
}
return ;
}

字符串连接:

#include <iostream>
#include <cstdio> using namespace std; int main()
{
char a[]="i love";
char b[]="you!";
char c[];
sprintf(c,"%s %s",a,b);
printf("%s",c);
return ;
}

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. Linux关于vm虚拟机复制后无法启动网卡

    1.一个月前由于自己一直在开发PHP站点,所以把Linux抛出去很长时间没有碰,最近几天把Linux的一些捡起来, 但在我设置vm虚拟机由于在家里做的实验未做完,复制到U盘想到公司接着做没成像,系统是 ...

  2. Java中Office(word/ppt/excel)转换成HTML实现

    运行条件:JDK + jacob.jar + jacob.dll 1) 把jacob.dll在 JAVA_HOME\bin\ 和 JAVA_HOME\jre\bin\ 以及C:\WINDOWS\sys ...

  3. Linux运维初级教程(二)账户与安全

    知识点 用户ID为UID,组ID为GID,UID=0表示超级管理员即root. 一个用户只可以加入一个基本组,但是可以同时加入多个附加组. 创建用户时,系统默认会自动创建同名的组,并设置用户加入该基本 ...

  4. python爬虫神器PyQuery的使用方法

    你是否觉得 XPath 的用法多少有点晦涩难记呢? 你是否觉得 BeautifulSoup 的语法多少有些悭吝难懂呢? 你是否甚至还在苦苦研究正则表达式却因为少些了一个点而抓狂呢? 你是否已经有了一些 ...

  5. OFFICE文档(DOC,XLS,PPT)打开报错的解决办法!

    一般情况下,打开OFFICE文档报错都是因为模板文件出错!! 至于为什么会出错这个问题不好说,可能是不正确关闭文档等等,重装OFFICE也不一定能解决问题! 出现这种情况一般是所有的Word文档或者E ...

  6. poj.1988.Cube Stacking(并查集)

    Cube Stacking Time Limit:2000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u Submi ...

  7. github 上传至远程的过程

    参考网址:http://luolei.org/dotfiles-tutorial/ http://www.ruanyifeng.com/blog/2014/06/git_remote.html     ...

  8. 08OC之Foundation框架

    1.Foundation框架简述 在前面,我们创建一个类的时候,都会选择Cocoa Class.到底Cocoa Class是什么东西呢? Cocoa 不是一门编程语言,因为它可以运行在多种编程语言上, ...

  9. HDU 1058 Humble Numbers(离线打表)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058 解题报告:输入一个n,输出第n个质因子只有2,3,5,7的数. 用了离线打表,因为n最大只有58 ...

  10. Android学习笔记(十五)——实战:强制下线

    //此系列博文是<第一行Android代码>的学习笔记,如有错漏,欢迎指正! 实现强制下线功能的思路也比较简单,只需要在界面上弹出一个对话框, 让用户无法进行任何其他操作, 必须要点击对话 ...