Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int a = sc.nextInt();
- int d = 0;
- int q = 0;
- for (int k = 0; k <= a; k++) {
- for (int c = 0; c<k && c<a-d; c++) {
- // System.out.println(k + " ");
- q++;
- }
- d+=q;
- System.out.println(d);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement