摘要: 1. 编写程序判断n是正数还是负数。 #include<stdio.h> main() { int a; printf("请输入一个数"); scanf("%d",&a); if(a>0) printf("%d是正数",a); else printf("%d是负数",a); } 2.使用条件运算符, 阅读全文
posted @ 2021-11-01 21:46 吃西瓜的鱼 阅读(28) 评论(0) 推荐(0)
摘要: 1。 1. #include<stdio.h> main() { int mark; printf("输入学生的分数(0-100):\n"); scanf("%d”,&mark); switch(mark/10) { case 10: //与case9:共用一条语句 case 9:printf("A 阅读全文
posted @ 2021-11-01 21:42 吃西瓜的鱼 阅读(12) 评论(0) 推荐(0)