ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1068. Sum

Помогите! В чем проблема?
Posted by yura 24 Jul 2012 12:39
import java.util.Scanner;
public class my9
{

    public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.println("Введите n");
int n=sc.nextInt();
int s=0;
if ((n>0) & (Math.abs(n)<=10000))
{
for (int i=1;i<=n;i++)
s=s+i;
}
else if ((n<=0) & (Math.abs(n)<=10000))
{
for (int i=n;i<=1;i++)
s=s+i;
}
System.out.println(s);

}
}
Re: Помогите! В чем проблема?
Posted by Sylap 16 Aug 2012 09:34
Убери строку :
System.out.println("Введите n");

Можно вывести только ответ.