TSORT : Getting Wrong answer

Below is my code for TSORT. I checked it multiple times and looks good, but still I get “wrong answer”. Please help!!

=====

#include <stdio.h>

int main(void)
{
unsigned int array[1000001] = {0};
unsigned int t;
unsigned int value = 0;
char temp=0;

scanf("%d",&t);

while(t) {
    scanf("%d",&value);
    array[value] = array[value] + 1;
    t--;
}
t = 0;

while(t<=1000000) {
    if(array[t] >= 1) {
        for(temp=1; temp<=array[t]; temp++) {
            printf("%d\n",t);
        }
    }
    t++;
}
return 0;

}

Change

char temp;

to

int temp;

Your AC code :


[1]


  [1]: https://www.codechef.com/viewsolution/18919137

Oh my God!!, this was really a silly mistake.
Thanks a lot for pointing this out.

Regards,
Manish