jAVA HDU1001题

import java.util.Scanner;
public class Main {
public static void main(String args[])
{ Scanner cin=new Scanner(System.in);
while(cin.hasNextInt())
{
int a=cin.nextInt();
int sum=0;
for(int i=0;i<=a;i++)
sum+=i;
System.out.println(sum+"\n\n");
}
}
}

posted @ 2016-03-05 19:34  折腾青春  阅读(199)  评论(0编辑  收藏  举报