All pastes #777124 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-16 15:26 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] << " ";	
        }
    
        //one pass sort
	for(unsigned int i=0; i<sizeof(array)/sizeof(array[0]); ++i) {
		++sortedarray[array[i]];
  	}

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

}