All pastes #777275 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-16 17:56 UTC
rendered paste body
#include <iostream>

int main() {
	const int max=200;
	const int size=100;
	int array[size];
	int sortedarray[max]={0};

	//create random array
        for(unsigned int i=0; i<sizeof(array)/sizeof(array[0]); ++i) {
    	        array[i] = rand()%max;
    	        std::cout << array[i] << " ";	
        }
    
        //sort
	for(unsigned int i=0; i<sizeof(array)/sizeof(array[0]); ++i) {
		++sortedarray[array[i]];
  	}

	int t=0;
	for(unsigned int i=0; i<sizeof(sortedarray)/sizeof(sortedarray[0]); ++i) {
		for(int s=0; s<sortedarray[i]; ++s) {
			array[t]=i;
			++t;	
		}
	}

	//print array
	std::cout << std::endl << std::endl;
        for(unsigned int i=0; i<sizeof(array)/sizeof(array[0]); ++i) {
    	        std::cout << array[i] << " ";	
        }

}