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 ;
}
上一篇:ORM与hibernate概述


下一篇:PHP store session with couchbase