- 博客(7)
- 收藏
- 关注
原创 分数
#include <stdio.h>#include<stdlib.h>int main(){ int score[10]; int maxScore = 0; int maxStudent = 0; int i; for (i = 0; i <= 10; i++) { printf("请输入第%d位学生的成绩: ",i); scanf_s("%d", &...
2018-05-02 16:53:03 181 3
原创 猜数游戏C++
源代码#include <stdlib.h>#include <stdio.h>#include <time.h>/*用时间做随机数种子使每次产生不同的随机数 */int main( ){ int magic; int guess; int counter; /*引入计数器变量 */ srand((unsigned int)t...
2018-03-28 21:00:09 1157 3
原创 输出99乘法表C++
源代码#include <stdio.h>int main( ){int i,j;for(i=1;i<10;i++) printf("%4d",i);printf("\n--------------------------------\n"); for(i=1;i<10;i++) for(j=1;j<10;j++) if(j!=9) pr...
2018-03-28 19:46:34 2615 7
原创 switch语句练习C++(月份)
#include <stdio.h>int main( ){ int month; printf("请输入一个月份: "); scanf("%d",&month); switch(month) { case 1:printf("January\n"); break; case 2:printf("F...
2018-03-23 19:17:36 1583 5
原创 找出1-1000之间的完数C++
一个数如果恰好等于它的因子之和,就被成为完数。例如6的因子为1,2,3,而6=1+2+3,所以6是一个完数。编程找出1-1000之间的所有完数,并按照从小到大的顺序输出,输出的每个数都必须以回车结尾。源代码:#include<stdio.h>int main( ){ int i,j; for(i=1;i<=1000;i++) { int sum...
2018-03-22 18:44:01 12318 7
原创 百钱百鸡C++
一只公鸡值5钱,一只母鸡值3钱,三只小鸡值1钱,现在用百钱买百鸡,请问公鸡、母鸡、小鸡各多少只?输出结果a,b,c,d,e,f.....(a,d...对应公鸡数量,b,e...对应母鸡数量,c,f...对应小鸡数量)#include <stdio.h>int main(){ int x,y,z; for (x = 0;x <= 20;x++) { ...
2018-03-21 20:57:54 2905 10
原创 闰年C++
#include <stdio.h>int main( ){ int x; scanf("%d",&x); if(x%400==0||(x%4==0&&x%100!=0)) printf("yes\n"); else printf("no\n"); return 0;}...
2018-03-21 20:44:46 1852 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人