#include <iostream>
#include<time.h>
using namespace std;
int main(){
int zero=0,one=0, two=0, three=0, four=0;
for(int i=0;i<100;i++){
srand ( time(NULL) );
Richland = rand() % 5;
switch(Richland){
case 0:
zero++;
break;
case 1:
one++;
break;
case 2:
two++;
break;
case 3:
three++;
break;
case 4:
four++;
break;
}
}
cout<<"The value of zeroes: "<<zero<<endl;
cout<<"The value of ones: "<<one<<endl;
cout<<"The value of twos: "<<two<<endl;
cout<<"The value of threes: "<<three<<endl;
cout<<"The value of fours: "<<four<<endl;
return 0;
}
int main(){
int zero=0,one=0, two=0, three=0, four=0;
for(int i=0;i<100;i++){
srand ( time(NULL) );
Richland = rand() % 5;
switch(Richland){
case 0:
zero++;
break;
case 1:
one++;
break;
case 2:
two++;
break;
case 3:
three++;
break;
case 4:
four++;
break;
}
}
cout<<"The value of zeroes: "<<zero<<endl;
cout<<"The value of ones: "<<one<<endl;
cout<<"The value of twos: "<<two<<endl;
cout<<"The value of threes: "<<three<<endl;
cout<<"The value of fours: "<<four<<endl;
return 0;
}
No comments:
Post a Comment