I realized I haven't included my code in my previous email so here it is now. Any help would be appreciated. It compiled properly and output looks good but CodeLab doesn't like it.
I also ran in in a terminal and inspected the output, and it was just my input numbers and followed by one space.
What I am not seeing?
Here is my code and screen shots:
#include <iostream>
using namespace std;
int main(){
int n=11; // number of int to be read in, given. I ran it with various values.
int wasReadIn[50];
// copied to CodeLab from here up to (down to) return 0;
int x, i, j, k; //x will hold value from cin. My compiler allowed me to keep i for all loops below but showed warning. I guess it's a no no since CodeLab didn't accept it.
for(i=0;i<50;i++) //initilize bool array to false, or int array to zero
wasReadIn[i]=0;
for(j=0;j<n;j++) { //read from cin and increment value of corresponding array element
cin >> x;
wasReadIn[x]++;
}
for(k=0;k<50;k++) // print out in order of array wasReadIn, reiterating for duplicates
while(wasReadIn[k] > 0){
cout << k << " ";
wasReadIn[k]--;
}
return 0;
}
Best wishes,
Manor