Kalendarz na dany miesiąc w roku 2008
Kod był wyświetlany 1665 razy.
    /*
  Name: Kalendarz na dany miesiąc w roku 2008
  Copyright: GPL GNU
   Date: 11-11-10 23:42
  Description: 
  Napisz program KALENDARZ, drukujący na ekranie kalendarz na zadany 
  miesiąc.
*/

#include <iostream>
using namespace std;
int main()
{
    int m;
    cout<<"\n\n\t PROGRAM KALENDARZ ROK 2008 - DRUKUJE KALENDARZ NA ZADANY MIESIAC";
    cout<<"\n\n\t Podaj miesiac: ";
    cin>>m;
    cout<<"\n\n";
    while(m<1 || m>12)  //wymaga podania poprawngo miesiąca
    {
        cout<<"\n\n\t Nie ma takiego miesiaca!!";     
        cout<<"\n\n\t Podaj miesiac jeszcze raz: ";
        cin>>m;
        cout<<"\n";
    }      
    if(m==1 || m==7)
    {
        cout<<" PN\t\t7\t14\t21\t28\n\n WT\t1\t8\t15\t22\t29\n\n"; 
        cout<<" SR\t2\t9\t16\t23\t30\n\n CZW\t3\t10\t17\t24\t31\n\n ";
        cout<<"PT\t4\t11\t18\t25\n\n SO\t5\t12\t19\t26\n\n ND\t6\t13\t20\t27";
    } 
    if(m==4)
    {   cout<<" PN\t\t7\t14\t21\t28\n\n WT\t1\t8\t15\t22\t29\n\n"; 
        cout<<" SR\t2\t9\t16\t23\t30\n\n CZW\t3\t10\t17\t24\n\n ";
        cout<<"PT\t4\t11\t18\t25\n\n SO\t5\t12\t19\t26\n\n ND\t6\t13\t20\t27"; 
    }
    if(m==3 || m==11)
    {
        cout<<" PN\t\t3\t10\t17\t24\t31\n\n WT\t\t4\t11\t18\t25\n\n"; 
        cout<<" SR\t\t5\t12\t19\t26\n\n CZW\t\t6\t13\t20\t27\n\n ";
        cout<<"PT\t\t7\t14\t21\t28\n\n SO\t1\t8\t15\t22\t29\n\n ND\t2\t9\t16\t23\t30"; 
    }    
    if(m==2)
    {
        cout<<" PN\t\t4\t11\t18\t25\n\n WT\t\t5\t12\t19\t26\n\n"; 
        cout<<" SR\t\t6\t13\t20\t27\n\n CZW\t\t7\t14\t21\t28\n\n ";
        cout<<"PT\t1\t8\t15\t22\t29\n\n SO\t2\t9\t16\t23\n\n ND\t3\t10\t17\t24"; 
    }  
    if(m==8)
    {   cout<<" PN\t\t4\t11\t18\t25\n\n WT\t\t5\t12\t19\t26\n\n"; 
        cout<<" SR\t\t6\t13\t20\t27\n\n CZW\t\t7\t14\t21\t28\n\n ";
        cout<<"PT\t1\t8\t15\t22\t29\n\n SO\t2\t9\t16\t23\t30\n\n ND\t3\t10\t17\t24\t31"; 
    }  
    if(m==9)
    {   cout<<" PN\t1\t8\t15\t22\t29\n\n WT\t2\t9\t16\t23\t30\n\n"; 
        cout<<" SR\t3\t10\t17\t24\n\n CZW\t4\t11\t18\t25\n\n ";
        cout<<"PT\t5\t12\t19\t26\n\n SO\t6\t13\t20\t27\n\n ND\t7\t14\t21\t28"; 
    } 
    if(m==12) 
    {   cout<<" PN\t1\t8\t15\t22\t29\n\n WT\t2\t9\t16\t23\t30\n\n"; 
        cout<<" SR\t3\t10\t17\t24\t31\n\n CZW\t4\t11\t18\t25\n\n ";
        cout<<"PT\t5\t12\t19\t26\n\n SO\t6\t13\t20\t27\n\n ND\t7\t14\t21\t28"; 
    }    
    if(m==5) 
    {   cout<<" PN\t\t5\t12\t19\t26\n\n WT\t\t6\t13\t20\t27\n\n"; 
        cout<<" SR\t\t7\t14\t21\t28\n\n CZW\t1\t8\t15\t22\t29\n\n ";
        cout<<"PT\t2\t9\t16\t23\t30\n\n SO\t3\t10\t17\t24\t31\n\n ND\t4\t11\t18\t25"; 
    }       
    if(m==10)
    {   cout<<" PN\t\t6\t13\t20\t27\n\n WT\t\t7\t14\t21\t28\n\n"; 
        cout<<" SR\t1\t8\t15\t22\t29\n\n CZW\t2\t9\t16\t23\t30\n\n ";
        cout<<"PT\t3\t10\t17\t24\t31\n\n SO\t4\t11\t18\t25\n\n ND\t5\t12\t19\t26"; 
    }    
    if(m==6)
    {
        cout<<" PN\t\t2\t9\t16\t23\t30\n\n WT\t\t3\t10\t17\t24\n\n"; 
        cout<<" SR\t\t4\t11\t18\t25\n\n CZW\t\t5\t12\t19\t26\n\n ";
        cout<<"PT\t\t6\t13\t20\t27\n\n SO\t\t7\t14\t21\t28\n\n ND\t1\t8\t15\t22\t29"; 
    }  
    cin.ignore();
    getchar();
    return 0;
}    
Pobierz plik tekstowy
Administrator WJL
PHP&SQL coded by NOVA-IT