#include<stdio.h> int main() { int x=1234; float f=123.456; double m=123.456; char ch=‘a‘; char a[]="Hello,world";//定义一个数组a,数组中连续存放了字符串常量Hello world int y=3,z=4; printf("%d %d\n",y,z); printf("y=%d,z=%d\n",y,z); printf("%8d,%2d\n",x,x); printf("%f,%8f,%8.1f,%0.2f,%.2e\n",f,f,f,f,f); printf("%1f\n",m); printf("%3c\n",ch); printf("%s\n%15s\n%10.5s\n%2.5s\n%.3s\n",a,a,a,a,a); return 0; }
#include<stdio.h> int main() { int level; printf("输入等级(1-5):"); scanf("%d",&level); switch(level){ case 1:printf("high翻了\n"); break; case 2:printf("low爆了\n"); break; default:printf("一言难尽\n"); }
return 0; }
原文:https://www.cnblogs.com/neorenaissance/p/10646115.html