Generate ladder of integers using the least number of unique characters (in C++) I am new to the sport of code golf. I am trying to generate a ladder of integers using the least number of unique characters in C++.

Let's say we are given an integer 4.

We will generate the following ladder:

1
1 2
1 2 3
1 2 3 4

In short, my program will read a positive integer from stdin and print this ladder to the output. I am trying to do so with the least number of unique characters possible.

My program is as follows:

#include&lt;iostream&gt;

int i;
int ii;
int iii;
int iiii;

main() {
    std::cin &gt;&gt; i;
    for(ii++; ii &lt;= i; ii++) {
        int iii = iiii;
        for(iii++; iii &lt;= ii; iii++) {
            std::cout &lt;&lt; iii &lt;&lt; " ";
        }
        std::cout &lt;&lt; std::endl;
    }
}


Here's the checker that I used to check the number of unique characters in my program:

#include &lt;cstdio&gt;
#include &lt;cstring&gt;
using namespace std;
int check[300],diffcnt=0,cnt=0,t;
char c;
double score;
int main(){

    memset(check,0,sizeof(check));
    FILE *in=fopen("ans.cpp","r");
    while(fscanf(in,"%c",&amp;c)!=EOF){
        cnt++;
        if(!check[c]){
            check[c]=1;
            if(c=='\r'||c=='\n') continue;
            diffcnt++;
        }
    }
    if(diffcnt&lt;25) printf("100\n");
    else if(diffcnt&lt;30){
        printf("%.3lf\n",20.0*100.0/cnt+20.0*(29-diffcnt));
    }
    else{
        score=20.0;
        for(int x=95;x&lt;cnt;x++) score*=0.9;
        printf("%.3lf\n",score);
    }
    printf("Unique Characters: %d\n", diffcnt);
    printf("Total Characters: %d\n", cnt);
    return 0;
}


Preferably I wish to use less than 25 unique characters to complete this program (excluding newline characters but including whitespace). Currently, my program uses 27. I am not sure how to optimize it further.

Could someone please advise me on how to optimize it further (in terms of the number of unique characters used)? Please note that only C++ can be used.
I believe I managed to remove the = character from your code, although it now is significantly slower

#include&lt;iostream&gt;

int i;
int ii;
int iii;
int iiii;

int main() {
    std::cin &gt;&gt; i;
    i++;
    for(ii++; ii &lt; i;) {
    for(;iii&gt;iiii;iii++);
    for(;iii&lt;iiii;iii++);
    ii++;
        for(iii++; iii &lt; ii; iii++) {
            std::cout &lt;&lt; iii &lt;&lt; " ";
        }
        std::cout &lt;&lt; std::endl;
    }
}


Its not pretty, but by abusing integer overflow we can get back to 0 without using =

Also we had to change the guards a little. Unfortunately because of the include I couldn't get rid of all new line characters (although its close) so that may be the next avenue for investigation. 

Edit: Run out of time for now, but if you include and use strstream and various other libraries, I think you may be able to remove the " character too, again using integers to arrive at the correct character for space and passing it into the strstream