摘要: 1.输出图形 #include <stdio.h> main() { int i,j; for(i=1;i<=5;i++) { for(j=1;j<=i;j++) { printf("*"); } printf("\n"); } } 2.输出图形 #include <stdio.h> main() 阅读全文
posted @ 2021-11-27 18:42 发挥吧du 阅读(10) 评论(0) 推荐(0) 编辑
摘要: .判断一个数n是正数还是负数 #include<stdio.h> main() { float n; printf("请输入一个数"); scanf("%f",&n); if (n>0){ printf("正数\n"); }else if (n==0){ printf("输出的数为0\n"); }e 阅读全文
posted @ 2021-11-27 18:32 发挥吧du 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 例4-8 #include<stdio.h> main() { int mark; printf("输入学生的分数(0-100):\n"); scanf("%d",&mark); switch(mark/10) { case 10: //与case 9共用同一条语句 case 9:printf("A 阅读全文
posted @ 2021-10-27 21:55 发挥吧du 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 编写程序,定义两个整数变量,赋值并输出。 #include<stdio.h> main() { int a=3; int b=6; printf("%d %d\n",a,b); } 5 编写程序,定义一个单精度和一个·双精度的变量,赋值·并输出 #include<stdio.h> main() { 阅读全文
posted @ 2021-10-18 20:55 发挥吧du 阅读(12) 评论(0) 推荐(0) 编辑
摘要: .编写程序,输出“我爱学习语言!”。 #include<stdio.h> main() { printf("我爱学习c语言!"); 2.分行输出自己的专业和名字 #include<stdio.h> main() { printf(" 沈阳科技学院\n 计算机科学与技术\n 李文浩\n"); 3.用* 阅读全文
posted @ 2021-09-28 14:16 发挥吧du 阅读(13) 评论(0) 推荐(0) 编辑