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 ...
随机推荐
- You need tcl 8.5 or newer in order to run the Redis test
安装Redis时候make test出现的 , 不用下什么tcl8.5再tar了 , 直接yum install tcl就好.
- JMeter非GUI方式运行时动态设置线程组及传参
http://blog.csdn.net/selingchen/article/details/48106517 在使用JMeter进行性能测试自动化时,可能会有如下需求: 1.指定运行多少线程,指定 ...
- uboot 、内核、文件系统移植
1. 参考下面博客: http://blog.csdn.net/andylauren/article/details/51448353 2.查看u盘: $ sudo fdisk -l 3. 格式化u盘 ...
- NodeJS学习历程 - (一)工具篇
后端工具 1.express:开发框架 npm install express 2.mongoose:MongoDB的处理插件 npm install mongoose 教程一:Mongoose全面理 ...
- Java 线程间通讯(管道流方式)
一.管道流是JAVA中线程通讯的常用方式之一,基本流程如下: 1)创建管道输出流PipedOutputStream pos和管道输入流PipedInputStream pis 2)将pos和pis匹配 ...
- NYOJ 49-开心的小明:01背包
点击打开链接 开心的小明 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 小明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间.更让他高兴的是 ...
- (medium)LeetCode 210.Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prer ...
- (转)c#多线程 Invoke方法的使用
原文地址:http://www.cnblogs.com/lovko/archive/2008/12/19/1358748.html 在多线程编程中,我们经常要在工作线程中去更新界面显示,而在多线程中直 ...
- ThreadLocal意为变量副本
http://blog.csdn.net/lufeng20/article/details/24314381
- IIS错误代码表
当用户试图通过 HTTP 或文件传输协议 (FTP) 访问一台正在运行 Internet 信息服务 (IIS) 的服务器上的内容时,IIS 返回一个表示该请求的状态的数字代码.该状态代码记录在 IIS ...