int month;
do {
cout << "Mo\tTu\tWe\tTh\tFr\tSa\tSu" << endl;
switch (month) {
case 1:{
system("pause");
do {
cout << "Enter number of month(1-12):";} while (month < 1 || month > 12);
cin >> month;
cout << "Mo\tTu\tWe\tTh\tFr\tSa\tSu" << endl;
switch (month) {
case 1:{
case 2:{int A[31]{};}
for (int i = 1; i <= 31; i++)
A[i - 1] = i;for (int i = 0; i < 35; i++) {
if (i < 4) {}
cout << "\t";}
continue;
cout << A[i - 4] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 3: {int A[29]{};}
for (int i = 1; i <= 29; i++)
A[i - 1] = i;for (int i = 0; i <29; i++) {
cout << A[i] << "\t";}
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 4: {int A[31]{};}
for (int i = 1; i <= 31; i++)
A[i - 1] = i;for (int i = 0; i < 32; i++) {
if (i == 0) {}
cout << "\t";}
continue;
cout << A[i - 1] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 5: {int A[30]{};}
for (int i = 1; i <= 30; i++)
A[i - 1] = i;for (int i = 0; i < 34; i++) {
if (i < 4) {}
cout << "\t";}
continue;
cout << A[i - 4] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 6: {int A[31]{};}
for (int i = 1; i <= 31; i++)
A[i - 1] = i;for (int i = 0; i < 37; i++) {
if (i < 6) {}
cout << "\t";}
continue;
cout << A[i - 6] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 7: {int A[30]{};}
for (int i = 1; i <= 30; i++)
A[i - 1] = i;for (int i = 0; i < 32; i++) {
if (i < 2) {}
cout << "\t";}
continue;
cout << A[i - 2] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 8: {int A[31]{};}
for (int i = 1; i <= 31; i++)
A[i - 1] = i;for (int i = 0; i < 35; i++) {
if (i < 4) {}
cout << "\t";}
continue;
cout << A[i - 4] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 9: {int A[31]{};}
for (int i = 0; i < 31; i++) {
A[i - 1] = i+1;}
cout << A[i-1] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 10: {int A[30]{};}
for (int i = 1; i <= 30; i++)
A[i - 1] = i;for (int i = 0; i < 33; i++) {
if (i < 3) {}
cout << "\t";}
continue;
cout << A[i - 3] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 11: {int A[31]{};}
for (int i = 1; i <= 31; i++)
A[i - 1] = i;for (int i = 0; i < 36; i++) {
if (i < 5) {}
cout << "\t";}
continue;
cout << A[i - 5] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
case 12: {int A[30]{};}
for (int i = 1; i <= 30; i++)
A[i - 1] = i;for (int i = 0; i < 31; i++) {
if (i==0) {}
cout << "\t";}
continue;
cout << A[i - 1] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
}int A[31]{};}
for (int i = 1; i <= 31; i++)
A[i - 1] = i;for (int i = 0; i < 34; i++) {
if (i < 3) {}
cout << "\t";}
continue;
cout << A[i - 3] << "\t";
if ((i + 1) % 7 == 0)
cout << endl;
cout << endl;
break;
system("pause");
Комментариев нет:
Отправить комментарий