摘要: 编写程序,使用scanf()函数接受整型实型字符型行的变量,并分行依次输出。 #include<stdio.h> main() { int a; float b; char c; scanf("%d,%f,%c",&a,&b,&c); printf("%d\n%f\n%c\n",a,b,c); } 阅读全文
posted @ 2021-10-31 22:18 澄憕 阅读(36) 评论(0) 推荐(0)
摘要: 教材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-31 22:17 澄憕 阅读(31) 评论(0) 推荐(0)
摘要: 编写程序判断n是正数还是负数。 #include<stdio.h> main(){ int n; printf("输入一个整数:\n"); scanf("%d",&n,n); if(n>0) printf("%d是正数!\n",n); else if(n==0) printf("%d既不是正数,也不 阅读全文
posted @ 2021-10-31 20:27 澄憕 阅读(37) 评论(0) 推荐(0)