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("请输入学生的分数(0-100):\n"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:pr
阅读全文
摘要:1.1. 编写程序,使用scanf()函数接收整型,实型,字符型,并分别依行输出 #include<stdi.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); }
阅读全文
摘要:编写程序,定义两个整形变量你,赋值并输出 #include<stdio.h> main() { int a=2; int b=6; printf("%d %d\n",a,b); } 编写程序,定义一个单精度和双精度的变量,赋值并输出 #include<stdio.h> main() { float
阅读全文
摘要:1;编写程序,输出”我爱学习C语言!” }#include<stdio.h> main() { printf("我爱C语言\n"); } 2.分行输出自己的班级和姓名. #include<stdio.h> main() { printf("班级:计算机2105\n姓名:杨智勇"); } 3.用*号输
阅读全文
浙公网安备 33010602011771号