|
|
вернуться в форумJava Accepted import java.util.Scanner; public class Main { public static void main(String[] args) { int c = 0; Scanner n = new Scanner(System.in); int f = n.nextInt(); n.close(); if (f > 0) { for (int i = 1; i <= f; i++) c += i; System.out.println(c); } else if (f <= 0) { for (int i = f; i <= 1; i++) c += i; System.out.println(c); } } } Re: Java Accepted Послано Sergey 13 янв 2023 19:45 Edited by author 13.01.2023 20:21 Re: Java Accepted Послано Ehab 20 ноя 2023 02:25 Man just use MATH (: |
|
|