Competitive Programming Solutions

GitHub
back to dashboard

B. Print

Codeforces - Sheet #5 (Functions) · limit: 1s · memory: 64MB · view on codeforces

input

5

output

1 2 3 4 5
Main.java
static void solve() {

        // Write your solution here
        int n = in.nextInt();
        int i = 1;
        while(i <= n){
            out.print(i++ + " ");
        }
    }