![]() |
#2
rjsp2012-11-03 08:31
|
#include <stdlib.h>
#include <iostream>
#include<time.h>
#include<math.h>
using namespace std;
int QQ(int n);
int hits[10];
int main()
{int n;
int i;
int r;
srand(time(NULL));
cout<<"请输入一个数";
cout<<"And press ENTER";
cin>>n;
for(i=1;i<=n;i++){
r=QQ(10);
hits[r]++;
}
system("PAUSE");
return EXIT_SUCCESS;
}
int QQ(int n){
return rand()%n;
}