#include <iostream>
#include <fstream>
usingnamespace std;
int main(){
ifstream fin("input.txt");
ofstream fout("output.txt");
int d[200] = {0}; //this sets every element of your array to 0
int n, x, i;
fin>>n;
for(i = 0; i < n; i++){//your code here was fine, but for loop here is more appropriate
fin>>x;
d[x]++;//note that user will have to enter integer in range [0; 200)
//if you want to expect range [-100; 100) write d[x+100]++;
}
for(x = 0; x < 200; x++)//note that in c++ arrays always start from 0.
for(i = 0; i < d[x]; i++)
fout<<x<<' ';//you may want to make this <<x-100 instead..
return 0;//int main() must return an integer
}