10 2021 档案

摘要:教材52页4-8. #include <stdio.h> main() { int mark; printf("输入学生的分数(0-100):\n"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:printf("A\n");break; 阅读全文
posted @ 2021-10-29 12:54 与花 阅读(30) 评论(0) 推荐(0)
摘要:编写程序,判断一个数n是正数还是负数。 #include <stdio.h> main() { float n; scanf("%f",&n); if(n>0) printf("正数\n"); else if(n==0) printf("0既不是正数,也不是负数\n"); else printf(" 阅读全文
posted @ 2021-10-24 21:41 与花 阅读(8) 评论(0) 推荐(0)
摘要:1、编写程序,定义两个整形变量,赋值并输出。 #include<stdio.h> main() { int a=1,b=2; printf("%d\n%d\n",a,b); } 2、编写程序,定义一个单精度和一个双精度的变量,赋值并输出。 #include<stdio.h> main() { flo 阅读全文
posted @ 2021-10-12 10:30 与花 阅读(78) 评论(0) 推荐(0)