1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
double m;
double d;
double y;
cout<<"Please input your date of birth in the format mm dd yy"<<endl;
cin>>m>>d>>y;
if (y>14)
{
switch(m)
{case '01':
cout<<"Your birthday is January "<<d<<", 19"<<y;
break;
case '02':
cout<<"Your birthday is February "<<d<<", 19"<<y;
break;
case '03':
cout<<"Your birthday is March "<<d<<", 19"<<y;
break;
case '04':
cout<<"Your birthday is April "<<d<<", 19"<<y;
break;
case '05':
cout<<"Your birthday is May "<<d<<", 19"<<y;
break;
case '06':
cout<<"Your birthday is June "<<d<<", 19"<<y;
break;
case '07':
cout<<"Your birthday is July "<<d<<", 19"<<y;
break;
case '08':
cout<<"Your birthday is August "<<d<<", 19"<<y;
break;
case '09':
cout<<"Your birthday is September "<<d<<", 19"<<y;
break;
case '10':
cout<<"Your birthday is October "<<d<<", 19"<<y;
break;
case '11':
cout<<"Your birthday is November "<<d<<", 19"<<y;
break;
case '12':
cout<<"Your birthday is December "<<d<<", 19"<<y;
break;
}
}
else
{
switch(m)
{case '01':
cout<<"Your birthday is January "<<d<<", 20"<<y;
break;
case '02':
cout<<"Your birthday is February "<<d<<", 20"<<y;
break;
case '03':
cout<<"Your birthday is March "<<d<<", 20"<<y;
break;
case '04':
cout<<"Your birthday is April "<<d<<", 20"<<y;
break;
case '05':
cout<<"Your birthday is May "<<d<<", 20"<<y;
break;
case '06':
cout<<"Your birthday is June "<<d<<", 20"<<y;
break;
case '07':
cout<<"Your birthday is July "<<d<<", 20"<<y;
break;
case '08':
cout<<"Your birthday is August "<<d<<", 20"<<y;
break;
case '09':
cout<<"Your birthday is September "<<d<<", 20"<<y;
break;
case '10':
cout<<"Your birthday is October "<<d<<", 20"<<y;
break;
case '11':
cout<<"Your birthday is November "<<d<<", 20"<<y;
break;
case '12':
cout<<"Your birthday is December "<<d<<", 20"<<y;
break;
}
}
system("Pause");
return 0;
}
|