10 2021 档案
摘要:1.程序编写,判断一个数n是正数还是负数 #include<stdio.h> main() { int n; printf("输入一个整数:\n"); scanf("%d",&n); if(n>0) printf("%d是正数!\n",n); else if(n==0) printf("%d既不是正
阅读全文
摘要: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");
阅读全文
摘要:1编写程序,使用if的多分支选择结构,将输入分数mark(0-100整数)转换为相应的等级)(900~100为A,80~89为B,70~79为C,60~69为D,0~59为NO PASS) #include<stdio.h> main() { int mark; printf("输入学生的分数(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(
阅读全文
摘要:1,编写程序,定义两个整型变量,赋值并输出 #include<stdio.h> main(){ int a=3; int b=4; printf("%d %d\n",a,b); 2.编写程序,定义一个单精度和一个双精度的变量,赋值并输出 #include<stdio.h> main(){ float
阅读全文
摘要:1.编写程序,输出"我爱学习C语言!" #include<stdio.h> main() { printf("我爱学习C语言!"); } 2.分行输出自己的专业和姓名 #include<stdio.h> main() { printf("班级:计算机2106\n姓名:杨宇喆"); } 3.用*号输出
阅读全文
浙公网安备 33010602011771号