C语言编写选票统计程序
1、首先打开VC++

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

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

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");/*计算每个候选者的平均票数*/

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:21
阅读量:49
阅读量:94
阅读量:33
阅读量:35