摘要: 编写程序,使用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)
摘要: #include<stdio.h> main(){ int a=2; int b=6; printf("%d%d\n",a,b); } #include<stdio.h> main() { float m=1.23; double n=4.56; printf("%f%lf\n",m,n); } # 阅读全文
posted @ 2021-10-18 20:30 澄憕 阅读(34) 评论(0) 推荐(0)
摘要: 一、编写程序。 编写程序,输出“我爱C语言!”。 #include<stdio.h> main() { printf("我爱学习C语言!"); } 分行输出自己的专业和姓名。 #include<stdio.h> main() { printf("计算机科学与技术\n"); printf("许志威\n 阅读全文
posted @ 2021-10-18 20:27 澄憕 阅读(17) 评论(0) 推荐(0)