|
|
вернуться в форумOn Eclipse working perfect. Why WA? Послано yohoho 28 дек 2013 05:22 import java.util.Scanner; public class Test { public static void main(String[] args) {
Scanner in = new Scanner(System.in); float b = 0; float a = in.nextInt(); in.close(); if ( a >= 1) { b = ((a + 1) /2) * a;
System.out.println((int)b);}
else
{ b = ((-a + 1) /2) * -a; System.out.println((int)-b+1);} }} Edited by author 28.12.2013 05:22 |
|
|