#include <iostream>
#include<time.h>
using namespace std;
int main(){
srand ( time(NULL) );
int zero=0,one=0, two=0, three=0, four=0;
int Richland = rand() % 3;
for(int i=0;i<100;i++){
Richland = rand() % 3;
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(){
srand ( time(NULL) );
int zero=0,one=0, two=0, three=0, four=0;
int Richland = rand() % 3;
for(int i=0;i<100;i++){
Richland = rand() % 3;
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