12345678910111213141516171819202122232425262728 |
- /**
- * Created by iyasuwatts on 10/17/17.
- */
- import java.util.Scanner;
- public class Main {
-
- public static void main(String[] args){
-
- Scanner n = new Scanner(System.in);
-
- int one = 1;
-
- //get input
- System.out.println("Enter a number: ");
- int num = n.nextInt();
-
- int count = 0;
-
- for(int i = one; i < num; i++)
- {
- System.out.println("Numbers below yours: " + i);
- count += i;
-
- }
- System.out.println("total " + count);
- }
- }
|