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. Python IDE: Eclipse + PyDev

    依次下载 Python.Django(并安装好).JAVA.Eclipse.Eclipse 中文语言包(http://www.eclipse.org/babel/downloads.php).PyDe ...

  2. 找不到类型“{x}.{x}”,它在 ServiceHost 指令中提供为 Service 特性值,或在配置元素 system.serviceModel/serviceHostingEnvironment/serviceActivations 中提供。

    最近在搞一个WCF的项目... 刚开始在这条路上走... 各种崎岖... 网上搜到的一种解决方案(也是大多数情况的解决方案): 原文:http://www.cnblogs.com/Olive116/p ...

  3. hdu.5211.Mutiple(数学推导 && 在logn的时间内求一个数的所有因子)

    Mutiple  Accepts: 476  Submissions: 1025  Time Limit: 4000/2000 MS (Java/Others)  Memory Limit: 6553 ...

  4. 我们为之奋斗过的C#-----C#的一个简单理解

    我们首先来简单叙述一下什么是.NET,以及C#的一个简单理解和他们俩的一个区别. 1 .NET概述 .NET是Microsoft.NET的简称,是基于Windows平台的一种技术.它包含了能在.NET ...

  5. JS快速获取图片宽高的方法

    快速获取图片的宽高其实是为了预先做好排版样式布局做准备,通过快速获取图片宽高的方法比onload方法要节省很多时间,甚至一分钟以上都有可能,并且这种方法适用主流浏览器包括IE低版本浏览器. 我们一步一 ...

  6. 剑指Offer 二维数组中的查找

    题目描述 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序.请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数. 思路法一: * 矩阵是 ...

  7. WebStorm设置左侧菜单栏背景色和样式

    WebStrom一直以来都是默认的白色主题,今天想修改了下主题皮肤,结果导致左侧项目资源栏和顶部菜单栏也变成了黑色,结果无法改变回来,网上查了各种帖子,居然也没找到解决方法,自己研究了半天,终于搞定了 ...

  8. xp远程桌面登陆需要身份验证问题解决

    今天在客户这边部署了一个专门用于远程访问的计算机,但是系统是xp,windows服务器最新的已经到2012版本了,windows服务器从2008开始就要求远程桌面登陆支持nla,因此在使用xp登陆wi ...

  9. 蓝牙模块连接后出现ANR,日志记录

    11-25 16:29:48.433 14507-14561/myapplication.com.myblue W/MALI: glDrawArrays:714: [MALI] glDrawArray ...

  10. NET程序内存分析工具CLRProfiler的使用(性能测试)

    http://blog.csdn.net/wy3552128/article/details/8158938 大家都知道.net有一套自己的内存(垃圾)回收机制,除非有一些数据(方法)长期占有内存不随 ...