实验一 C语言开发环境使用和数据类型、运算符、表达式
#include <stdio.h> int main(){ int x; printf("输入一个整数:\n"); scanf("%d",&x); if(x%2!=0) printf("是奇数"); else printf("是偶数"); return 0; }
#include <stdio.h> int main() { int days; scanf("%d",&days); printf("输入一个整数: \n"); if(days>=1&&days<=5) printf("workdays,fighting\n"); else if(days==6||days==7) printf("weekend, relax~\n"); else printf("ooops, not in 1~7\n"); return 0; }
#include <stdio.h> int main() { char ch; printf("输入一个字符:\n"); scanf("%c",&ch); if(ch>='a'&&ch<='z') ch=ch-32; printf("%c\n",ch); return 0; }
posted on 2019-03-24 20:42 a1076235045 阅读(92) 评论(0) 编辑 收藏 举报