Advertisement
Hansikk

isikukood

Mar 15th, 2011
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cstdlib>
  4. #include <stdio.h>
  5. #include <math.h>
  6. #include <iomanip>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     //int aasta;
  13.     char isikukood[20];
  14.     cout << "Sisestage oma isikukood:" << endl;
  15.     cin >> isikukood;
  16.  
  17.     if (isikukood[0]=='3')
  18.     {
  19.         cout << "Te olete meessoost ning";
  20.     }
  21.     else if (isikukood[0]=='4')
  22.     {
  23.         cout << "Te olete naissoost ning";
  24.     }
  25.     cout << " te olete syndinud 19" << isikukood[1] << isikukood[2] << " aastal, " << isikukood[5] << isikukood[6] << ".";
  26.  
  27.     switch (isikukood[3])
  28.     {
  29.         case '0':
  30.             switch (isikukood[4])
  31.             {
  32.                 case '1':
  33.                     cout << " jaanuaril ";
  34.                 case '2':
  35.                     cout << " veebruaril ";
  36.                 case '3':
  37.                     cout << " m2rtsil ";
  38.                 case '4':
  39.                     cout << " aprillil ";
  40.                 case '5':
  41.                     cout << " mail ";
  42.                 case '6':
  43.                     cout << " juunil ";
  44.                 case '7':
  45.                     cout << " juulil ";
  46.                 case '8':
  47.                     cout << " augustil ";
  48.                 case '9':
  49.                     cout << " septembril ";
  50.             }
  51.         case '1':
  52.             switch (isikukood[4])
  53.             {
  54.                 case '0':
  55.                     cout << " oktoobril ";
  56.                 case '1':
  57.                     cout << " novembril ";
  58.                 case '2':
  59.                     cout << " detsembril ";
  60.             }
  61.     }
  62.     cout << endl << endl;
  63.  
  64.     system("pause");
  65.     return 0;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement