Skip to main content
2 of 3
added 94 characters in body
TheNumberOne
  • 11.6k
  • 1
  • 38
  • 70

#Java, 85 84 bytes

This is surprisingly short in Java.

void a(int a){String b="";for(int c=0;c++<a;System.out.println(b+=(c>1?" ":"")+c));}

Indented:

void a(int a){
    String b="";
    for(int c=0;
        c++<a;
        System.out.println(
                b+=(c>1?" ":"")+c
        ));
}

1 byte thanks to Bigtoes/Geobits

TheNumberOne
  • 11.6k
  • 1
  • 38
  • 70