10 2021 档案

摘要:1 编写程序,判断n是正数还是负数。 #include<stdio.h> main() { int n; printf("请输入一个数"); scanf("%d",&n); if(n>0) printf("n是正数"); else printf("n是负数"); } 2 使用条件运算符,找出a,b, 阅读全文
posted @ 2021-10-30 11:31 赵雅萌 阅读(55) 评论(0) 推荐(0)
摘要:1 例4-8 #include<stdio.h> main() { int mark; printf("输入学生的分数(0-100):"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:printf("A\n"); break; case 阅读全文
posted @ 2021-10-28 20:42 赵雅萌 阅读(21) 评论(0) 推荐(0)
摘要:1 编写程序,判断一个数n是正数还是负数。 #include<stdio.h> main() { float n; scanf("%f",&n); if(n>0) printf("正数!\n"); else if(n==0) printf("0既不是正数也不是负数"); else printf("负 阅读全文
posted @ 2021-10-23 20:24 赵雅萌 阅读(37) 评论(0) 推荐(0)
摘要:1 编写程序,定义两个整型变量,赋值并输出。 #include<stdio.h> main() { int a=2; int b=6; printf("%d%d\n",a,b); } 2 编写程序,定义一个单精准度和一个双精准度的变量,赋值并输出。 #include<stdio.h> main() 阅读全文
posted @ 2021-10-16 16:01 赵雅萌 阅读(377) 评论(0) 推荐(0)
摘要:1编写程序,输出我爱c语言 1 编写程序 输出我爱C语言 #include<stdio.h> main() { printf("我爱c语言"); } 2 分行输出自己的专业和姓名 #include<stdio.h> main() { printf("计算机科学与技术\n赵雅萌"); } 3 用*号输 阅读全文
posted @ 2021-10-03 14:07 赵雅萌 阅读(76) 评论(0) 推荐(0)