Smipple is shutting down Nov 30, 2017. Some features are currently disabled.
Profile image for Jinghua Guo SkyFish
Homework_Print Calendar
Language
C
Tags
C

Date

1 #include<stdio.h> 2 int main() 3 { 4 int a,day; 5 scanf("%d",&a); 6 day=(a==7?1:1-a); 7 printf("SUN MON TUE WED THU FRI SAT\n"); 8 while(day<32) 9 { 10 if(day<=0) 11 printf(" "); 12 else 13 { 14 printf("%3d",day); 15 a++; 16 if(a%7==0) 17 printf("\n"); 18 else 19 printf(" "); 20 } 21 day++; 22 } 23 return 0; 24 }

Comments