12345678910111213141516171819202122232425262728
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.Scanner;
  5. public class Main {
  6. public static void main(String[] args){
  7. Scanner n = new Scanner(System.in);
  8. int one = 1;
  9. //get input
  10. System.out.println("Enter a number: ");
  11. int num = n.nextInt();
  12. int count = 0;
  13. for(int i = one; i < num; i++)
  14. {
  15. System.out.println("Numbers below yours: " + i);
  16. count += i;
  17. }
  18. System.out.println("total " + count);
  19. }
  20. }