HDU 1000 & HDU1001 & 字符串连接
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
B. Process to end of file.
line.
#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
Judge).
In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 +
... + n.
integer per line.
blank line. You may assume the result will be in the range of 32-bit signed
integer.
100
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 & 字符串连接的更多相关文章
- hdu 1000&hdu1001
1001 #include<iostream> #include<stdio.h> using namespace std; int main() { long long n; ...
- hdu 5510 Bazinga(字符串kmp)
Bazinga Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Sub ...
- ytu 1052: 写一函数,将两个字符串连接(水题,指针练习)
1052: 写一函数,将两个字符串连接 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 343 Solved: 210[Submit][Status][ ...
- 关于python字符串连接的操作
python字符串连接的N种方式 注:本文转自http://www.cnblogs.com/dream397/p/3925436.html 这是一篇不错的文章 故转 python中有很多字符串连接方式 ...
- js ES6 多行字符串 连接字符串
1. 以前,js多行字符串用\n写起来比较费事,所以最新的ES6标准新增了一种多行字符串的表示方法,用` ... `表示: 旧版写法 alert("你好,\n 我叫\n Olive" ...
- python字符串连接的N种方式
python中有很多字符串连接方式,今天在写代码,顺便总结一下: 最原始的字符串连接方式:str1 + str2 python 新字符串连接语法:str1, str2 奇怪的字符串方式:str1 st ...
- SQL注入的字符串连接函数
在select数据时,我们往往需要将数据进行连接后进行回显.很多的时候想将多个数据或者多行数据进行输出的时候,需要使用字符串连接函数.在sqli中,常见的字符串连接函数有concat(),group_ ...
- Swift语言—有趣的字符串连接、数组、字典
字符串链接:Swift语言中的字符串连接方式本人觉得非常的有趣,变量连接需要用右斜杠,并且变量名要括起来 “\(变量名)”,后面的字符串连接分别用逗号 ‘ , ’ 隔开 数组: Var arr = [ ...
- python 字符串连接
字符串连接 方法1: 用字符串的join方法 a = ['a','b','c','d']content = ''content = ''.join(a)print content 方法2: 用字符串的 ...
随机推荐
- css外边距合并和z-index的问题
参考这篇文章, 将外边距的 折叠 参考这篇文章, 将bfc的生成, bfc的应用 参考这篇文章 position: absolute的元素, 仍然具有内填充padding和border边框属性样式, ...
- FireBug调试工具笔记
Firebug是网页浏览器 Mozilla Firefox下的一款开发类插件, 现属于Firefox的五星级强力推荐插件之一.它集HTML查看和编辑.Javascript控制台.网络状况监视 ...
- 使用MVVM框架(avalonJS)进行快速开发
背景 在运营活动开发中,因为工作的重复性很大,同时往往开发时间短,某些情况下也会非常紧急,导致了活动开发时间被大大压缩,同时有些活动逻辑复杂,数据或者状态变更都需要手动渲染,容易出错,正是因为这些问题 ...
- 基础知识系列☞MSSQL→约束
遇到一个数据库设计很渣的系统··· 本来一个约束就能解决的问题·以前建库的时候也不设计好···
- Linux 之安装文件
1.首先要检查 rpm -q gcc glibc glibc-common rrdtool rrdtool-devel expat expat-devel pcre pcre-devel dejavu ...
- springMVC-1
1.springMVC请求由前端到后端的流程 2.配置过程 (1)需要的jar包 spring-aop.jar spring-beans.jar spring-context.jar spring-c ...
- DEV控件Grid显示行号
DEV控件Grid的显示行号需要通过一个事件来设置,具体设置代码为: private void gridView1_CustomDrawRowIndicator(object sender, DevE ...
- Python进程、线程
Lock & RLock :用来确保多线程多共享资源的访问. Semaphore : 用来确保一定资源多线程访问时的上限,例如资源池. Event : 是最简单的线程间通信的方式,一个线程可以 ...
- 导致页面顶部空白一行解决方法
模板文件生成html文件之后会在body开头处加入一个可见的控制符,导致页面头部会出现一个空白行.原因是页面的编码是UTF-8 + BOM. 这种编码方式一般会在windows操 ...
- BurpSuite使用设置
一.设置字体 二.设置字符集 三.设置浏览器代理 四.BurpSuite访问步骤 五.在Target中可以查看截获的数据包