10 2021 档案

摘要:1. 编写程序,将输入的分数mark(0~100)转换为相应的等级90-100为A,80-89为B,70-79为C,60-69为D,0-59为NO PASS。 #include<stdio.h> main() { int mark; printf("输入学生的分数(0-100):"); scanf( 阅读全文
posted @ 2021-10-30 13:11 郭津彤 阅读(26) 评论(0) 推荐(0)
摘要:1. 判断一个数n是正数还是负数。 #include<stdio.h> main() { float n; printf("请输入一个数"); scanf("%f",&n); if(n>0) { printf("正数\n"); }else if(n==0){ printf("输出的数为0\n"); 阅读全文
posted @ 2021-10-27 19:46 郭津彤 阅读(17) 评论(0) 推荐(0)
摘要:1. 编写程序,定义两个整型变量,赋值并输出。 #include<stdio.h> main() { int a=3; int b=5; printf("%d%d\n",a,b); } 2. 编写程序,定义一个双精度变量和一个单精度变量,赋值并输出。 #include<stdio.h> main() 阅读全文
posted @ 2021-10-26 17:06 郭津彤 阅读(19) 评论(0) 推荐(0)
摘要:1.编写程序,输出“我爱学习C语言!”。 #include<stdio.h> main() { printf("我爱学习C语言!\n"); } 2.分行输出自己的专业和姓名。 #include<stdio.h> main() { printf("计算机科学与技术\n郭津彤\n"); } 3.用*号输 阅读全文
posted @ 2021-10-12 13:51 郭津彤 阅读(31) 评论(0) 推荐(0)