摘要: 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 阅读全文
posted @ 2021-11-06 18:38 KONE〈 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 编写程序,使用scanf()函数接受整型实型字符型行的变量,并分行依次输出。 #include<stdio.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); } 阅读全文
posted @ 2021-10-18 21:31 KONE〈 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 一、编写程序。 编写程序,输出“我爱C语言!”。 #include<stdio.h> main() { printf("我爱学习C语言!"); } 2.分行输出自己的专业和姓名。 #include<stdio.h> main() { printf("计算机科学与技术\n"); printf("孔一\ 阅读全文
posted @ 2021-10-18 21:23 KONE〈 阅读(20) 评论(0) 推荐(0) 编辑