#include <stdio.h> int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); if(x%2==1) printf("是奇数"); else printf("是偶数"); return 0; }
#include <stdio.h> int main() { int days; printf("输入一个整数: \n"); scanf("%d",&days); if (days==1||days==2||days==3||days==4||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('a'<=ch&&ch<='z') ch=ch-32; else if('A'<=ch&&ch<='Z') ch=ch; printf("%c\n",ch); return 0; }
体验感想:操作不熟练,规则不清晰,全程翻课本,百度。