#include <stdafx.h> #include <iostream> #include <string> using namespace std;
int pick,score=0,i=0,x=0; int uncommon[6] = {0,0,0,0,0,0}; string names[6];
int main() {
names[0]="Igor=0" ,names[1]="Alex=1" ,names[2]="Oleg=2" ,names[3]="Maya=3" ,names[4]="Oren=4" ,names[5]="Olga=5";
cout << "Hit list: "; for(i;i!=6; i++) cout << '\n' << names[i];if(i=5){cout<<'\n';} cout << "\nPick a name by its number.\n";
cin >> pick;
switch(pick) { case 0: uncommon[0] +=1; break; case 1: uncommon[1] +=1; break; case 2: uncommon[2] +=1; break; case 3: uncommon[3] +=1; break; case 4: uncommon[4] +=1; break; case 5: uncommon[5] +=1; break; default: cout << "\nPicked a wrong number\n"; main(); }
cout << "\nUncommon names:\n"; for(x=0; x!=6; x++) cout << '\n' << uncommon[x];if(x=6){cout<<'\n';} main();
return 0; }
|