10 2021 档案

摘要:1. 教材P52 例4-8 分数转成等级 switch #include <stdio.h> main() { int mark; printf("输入成绩\n"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:printf("A\n") 阅读全文
posted @ 2021-10-26 10:40 计算机2106尹金袁 阅读(17) 评论(0) 推荐(0)
摘要:1,编写程序,判断一个数n是正数还是负数 #include<stdio.h> main(){ float n; scanf("%f",&n); if(n>0) printf("正数!\n"); else if(n==0) printf("0既不是正数,也不是负数!\n"); else printf( 阅读全文
posted @ 2021-10-19 16:44 计算机2106尹金袁 阅读(32) 评论(0) 推荐(0)
摘要:1.编写程序,使用scanf()接收整型·实型·字符型的变量,并分行依次输出。 #include <stdio.h> main() { int a=1; float b=2; char c='5'; printf("%d\n%f\n%c\n",a,b,c); } 2.编写程序,通过scanf()函数 阅读全文
posted @ 2021-10-18 21:53 计算机2106尹金袁 阅读(27) 评论(0) 推荐(0)
摘要:1,编写程序,定义两个整型变量,赋值并输出 #include<stdio.h> main(){ int a=3; int b=4; printf("%d %d\n",a,b); } 2.编写程序,定义一个单精度和一个双精度的变量,赋值并输出 #include<stdio.h> main(){ flo 阅读全文
posted @ 2021-10-12 11:17 计算机2106尹金袁 阅读(89) 评论(0) 推荐(0)
摘要:1,编写程序,输出"我爱学习c语言!" #include<stdio.h> main(){ printf("我爱学习c语言"); } 2分行输出自己的专业和姓名 #include<stdio.h> main(){ printf("专业:计算机科学与技术 姓名:尹金袁"); } 3. 用*输出字母C的 阅读全文
posted @ 2021-10-01 13:23 计算机2106尹金袁 阅读(24) 评论(0) 推荐(0)