返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     re:
  7.     system("cls");
  8.     int a,b;
  9.     cout<<"請輸入該月的天數(28~31):";
  10.     cin>>a;
  11.     cout<<"請輸入該月的一號落在第一周的第幾天:";
  12.     cin>>b;
  13.     cout<<endl;
  14.     cout<<"日\t一\t二\t三\t四\t五\t六"<<endl;
  15.     for(int j=1;j<=a+b-1;j++)
  16.     {
  17.     if(j<b)
  18.     {
  19.     cout<<" \t";
  20.     }else
  21.     {
  22.          cout<<j-(b-1)<<" \t";
  23.     }
  24.     if(j%7==0)
  25.     {
  26.     cout<<endl;
  27.     }
  28.     }
  29.     cout<<endl;
  30.     cout<<endl;
  31.     system("pause");
  32.     goto re;
  33.     system("pause");
  34.     return 0;
  35. }
複製代碼

TOP

返回列表