C语言编写选票统计程序

2024-10-14 14:36:14

1、首先打开VC++

C语言编写选票统计程序

3、创建一个空白C++文档

C语言编写选票统计程序

5、主函数当然也要写上void main(){}

C语言编写选票统计程序

7、用while循环输入选票while(1){clrscr();/*输入候选者的人数*/printf("Input the num of the electees in the election:暧苗争死");scanf("%d",&ElecteeNum);if( ElecteeNum>1&&ElecteeNum<MAX )break;}/*输入每个年级的每个候选者的票数*/printf("Please input a ElecteeID and the votes of three nations:\n");printf(" ElecteeID GradeA GradeB GradeC\n");/*计算每个候选者的平均票数*/

C语言编写选票统计程序
猜你喜欢