#include<stdio.h>
#include<stdlib.h>
int main(){
int a=0,b=0,c=0,i=1,vote;
while(i<=10){
printf("<1>小蔡\n");
printf("<2>小王\n");
printf("<3>小史\n");
printf("請你投票:");
scanf("%d",&vote);
switch(vote){
case 1:a++;break;
case 2:b++;break;
case 3:c++;break;
default:break;
}
printf("\n小蔡得票數%d\n",a);
printf("小王得票數%d\n",b);
printf("小史得票數%d\n\n",c);
i++;
}
system("pause");
return 0;
}
沒有留言:
張貼留言