poj2000
为了凑今天的数,大水题。不解释了,说来惭愧。
#include <stdio.h>
int main(){
int n;
int i,cnt,j;
int tot;
while(~scanf("%d",&n)){
if(n==) break;
tot=;
cnt=;
j=;
for(i=;i<=n;++i){
tot+=cnt;
j++;
if(j==cnt){
j=;
cnt++;
}
}
printf("%d %d\n",n,tot);
}
return ;
}
poj2000的更多相关文章
- A过的题目
1.TreeMap和TreeSet类:A - Language of FatMouse ZOJ1109B - For Fans of Statistics URAL 1613 C - Hardwood ...
随机推荐
- Android NDK 构建 以及一些错误
首先下载NDK 然后在最外层的 local.properties文件夹中 写上 ndk的路径 ndk.dir=/Users/wyj/Desktop/androidStudioSdk/android- ...
- Apache Thrift学习之一(入门及Java实例演示)
目录: 概述 下载配置 基本概念 数据类型 服务端编码基本步骤 客户端编码基本步骤 数据传输协议 实例演示(java) thrift生成代码 实现接口Iface TSimpleServer服务模型 T ...
- Objective-C: 字符串NSString与NSMutableString
字符串算是OC中非常重要和常用的一部分内容,OC中的字符串与我之前在学习C,C++,Java中的字符串有一定的不同,它非常类似于C++中容器的概念,但用法却与之还是有很大的不同,也许是因为OC的语法就 ...
- oracle中的exists 和not exists 用法详解
有两个简单例子,以说明 “exists”和“in”的效率问题 1) select * from T1 where exists(select 1 from T2 where T1.a=T2.a) ; ...
- jhat中的OQL(对象查询语言)
http://blog.csdn.net/wanglha/article/details/40181767 jhat中的OQL(对象查询语言) 如果需要根据某些条件来过滤或查询堆的对象,这是可能的,可 ...
- sencha touch 开发准备
这是本人第一次写博客教程,没什么经验,文笔也不是很好,写这教程一方面为了巩固自己这段时间的学习成果,一方面帮助大家解决问题,欢迎大家多提建议,指出问题.接下来我们就开始我们的sencha touch开 ...
- poj 2388 Who's in the Middle
点击打开链接 Who's in the Middle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 28324 Acce ...
- 修改hive内存限制
错误: GB physical memory used; 4.7 GB of 2.1 GB virtual memory used. Killing container. Dump of the pr ...
- Java8新特性【转】
地址:http://ifeve.com/java-8-features-tutorial/ 1.简介 毫无疑问,Java 8是自Java 5(2004年)发布以来Java语言最大的一次版本升级,Ja ...
- Skill
Skill Yasser is an Egyptian coach; he will be organizing a training camp in Jordan. At the end of ca ...