正文
增加 25 行删除 25 行
22 行未改动232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925062 行未改动22 行未改动{cin >> n ;cout << "MON TUE WED THU FRI SAT SUN" << endl ;//每一个答案都会输出的东西//接下来就是枚举每一种情况,然后根据情况输出答案即可if(n == 1){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 5 || i == 12 || i == 19 || i == 26){cout << endl ;flag = true ;}}}if(n == 2){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 28 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 2 || i == 9 || i == 16 || i == 23){cout << endl ;flag = true ;}}}if(n == 3){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 2 || i == 9 || i == 16 || i == 23 || i == 30){cout << endl ;flag = true ;}}}if(n == 4){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 30 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 6 || i == 13 || i == 20 || i == 27){cout << endl ;flag = true ;}}}if(n == 5){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 4 || i == 11 || i == 18 || i == 25){cout << endl ;flag = true ;}}}if(n == 6){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 30 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 1 || i == 8 || i == 22 || i == 15 || i == 29){cout << endl ;flag = true ;}}}if(n == 7){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 6 || i == 13 || i == 20 || i == 27){cout << endl ;flag = true ;}}}if(n == 8){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 3 || i == 10 || i == 17 || i == 24){cout << endl ;flag = true ;}}}if(n == 9){bool flag = true ;for(int i = 1 ; i <= 30 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 7 || i == 14 || i == 21 || i == 28){cout << endl ;flag = true ;}}}if(n == 10){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 5 || i == 12 || i == 19 || i == 26){cout << endl ;flag = true ;}}}if(n == 11){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 30/*就错在这里!!!😭😭😭*/ ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 2 || i == 9 || i == 16 || i == 23 || i == 30){cout << endl ;flag = true ;}}}if(n == 12){bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 7 || i == 14 || i == 21 || i == 28){cout << endl ;flag = true ;}62 行未改动22 行未改动232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925062 行未改动22 行未改动{cin >> n ;cout << "MON TUE WED THU FRI SAT SUN" << endl ;//每一个答案都会输出的东西//接下来就是枚举每一种情况,然后根据情况输出答案即可if(n == 1){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 5 || i == 12 || i == 19 || i == 26){cout << endl ;flag = true ;}}}if(n == 2){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 28 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 2 || i == 9 || i == 16 || i == 23){cout << endl ;flag = true ;}}}if(n == 3){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 2 || i == 9 || i == 16 || i == 23 || i == 30){cout << endl ;flag = true ;}}}if(n == 4){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 30 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 6 || i == 13 || i == 20 || i == 27){cout << endl ;flag = true ;}}}if(n == 5){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 4 || i == 11 || i == 18 || i == 25){cout << endl ;flag = true ;}}}if(n == 6){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 30 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 1 || i == 8 || i == 22 || i == 15 || i == 29){cout << endl ;flag = true ;}}}if(n == 7){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 6 || i == 13 || i == 20 || i == 27){cout << endl ;flag = true ;}}}if(n == 8){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 3 || i == 10 || i == 17 || i == 24){cout << endl ;flag = true ;}}}if(n == 9){bool flag = true ;for(int i = 1 ; i <= 30 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 7 || i == 14 || i == 21 || i == 28){cout << endl ;flag = true ;}}}if(n == 10){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 5 || i == 12 || i == 19 || i == 26){cout << endl ;flag = true ;}}}if(n == 11){cout << " " ;bool flag = true ;for(int i = 1 ; i <= 30/*就错在这里!!!😭😭😭*/ ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 2 || i == 9 || i == 16 || i == 23 || i == 30){cout << endl ;flag = true ;}}}if(n == 12){bool flag = true ;for(int i = 1 ; i <= 31 ; i++){if(flag == true){printf("%3d" , i) ;flag = false ;}else printf("%4d" , i) ;if(i == 7 || i == 14 || i == 21 || i == 28){cout << endl ;flag = true ;}62 行未改动