#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;

int main(){

	int a[5]={0,0,0,0,0};
	int b[5]={0,2,1,2,6};//上限值

	int tmp;

	int i,j;

	for(i=0;i<10;i++)
	{
		tmp=rand()%5;
		if( a[tmp] < b[tmp] )
			a[tmp]++;
		else
			i--;
	}

	for( j=0 ; j<5 ; ++j )
		cout << a[j] << "\t";
	cout << endl;

return 0;
}
