10 2021 档案

摘要:编写程序判断n是正数还是负数。 #include<stdio.h> main() { int n; printf("输入一个整数:\n"); scanf("%d",&n); if(n>0) printf("%d是正数!\n"); else if(n==0) printf("%d既不是正数,也不是负数 阅读全文
posted @ 2021-10-31 21:33 AI-ccc 阅读(40) 评论(0) 推荐(0)
摘要:1. #include<stdio.h> main() { int mark; printf("输入学生的分数(0-100):\n"); scanf("%d”,&mark); switch(mark/10) { case 10: //与case9:共用一条语句 case 9:printf("A\n" 阅读全文
posted @ 2021-10-26 10:57 AI-ccc 阅读(54) 评论(0) 推荐(0)
摘要:编写程序,使用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); 2 阅读全文
posted @ 2021-10-17 21:04 AI-ccc 阅读(21) 评论(0) 推荐(0)
摘要:编写程序,定义两个整型变量,赋值并输出。 #include<stdio.h> main() { int a=2; int b=6; printf("%d%d\n",a,b); 2.编写程序,定义一个单精度和一个双精度的变量,赋值并输出。 #include<stdio.h> main() { floa 阅读全文
posted @ 2021-10-13 21:22 AI-ccc 阅读(52) 评论(0) 推荐(0)
摘要:1.编写程序,输出“我爱学习C语言!”。 #include<stdio.h> main() { printf("我爱学习C语言\n"); } 2.分行输出自己的专业和姓名。 #include<stdio.h> main() { printf("计算机科学与技术\n于程伍\n"); } 3.用*号输出 阅读全文
posted @ 2021-10-07 22:41 AI-ccc 阅读(28) 评论(0) 推荐(0)