ex2
作者:互联网
#include <stdio.h> int main() { int x=1234; int y=3, z=4; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello, world!"; 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("%lf\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 num ; scanf("%d",&num); printf("2020%04d\n",num); scanf("%d",&num); printf("2020%04d\n",num); scanf("%d",&num); printf("2020%04d\n",num); return 0 ; }
#include<stdio.h> int main(){ int x=0; int num; while(x==0){ scanf("%d",&num); printf("2020%04d\n",num); } return 0 ; }
标签:int,scanf,04d,2020%,num,ex2,printf 来源: https://www.cnblogs.com/lddsbk/p/14602297.html