摘要: 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既不是正数,也 阅读全文
posted @ 2021-11-15 20:23 只有子芊可以吗 阅读(18) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> main() { int mark; printf("请输入学生的分数(0-100):\n"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:printf("A\n");break; case 8:pr 阅读全文
posted @ 2021-11-15 20:22 只有子芊可以吗 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 1、编写程序,使用scanf()函数接受整型、实型、字符型的变量,并分行依次输出。 #include<stdio.h> main(){ int a; float b; char c; scanf("%d,%f,%c",&a,&b,&c); printf("%d--%f--%c\n",a,b,c); 阅读全文
posted @ 2021-10-19 21:07 只有子芊可以吗 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 1、编写程序,使用scanf()函数接受整型、实型、字符型的变量,并分行依次输出。 #include<stdio.h> main(){ int a; float b; char c; scanf("%d,%f,%c",&a,&b,&c); printf("%d--%f--%c\n",a,b,c); 阅读全文
posted @ 2021-10-16 21:02 只有子芊可以吗 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 3.#include<stdio.h>main(){char cl='E';printf("%c--%d\n",cl,cl);}4.#include<stdio.h>main(){ int a=6;float b=7.68;printf("%d\n",a+(int)b);}5定义两个变量a,b并赋值 阅读全文
posted @ 2021-10-16 21:00 只有子芊可以吗 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1.编写程序,输出“我爱学习C语言!” #include<stdio.h>main(){ printf("我爱C语言!\n");} 2.分行输出自己的专业和姓名 #include<stdio.h>main(){ printf("信息与控制工程系\n计算机科学技术\n朱其武");} 3.用*号输出字母 阅读全文
posted @ 2021-10-16 20:59 只有子芊可以吗 阅读(11) 评论(0) 推荐(0) 编辑