#include <iostream>
using namespace std;
bool CheckDate(int d, int m, int y)
{
return d>0 && d<=31 && m>0 && m<=12 && y>0 ;
}
int main()
int day,mounth,year;
cin>>day>>mounth>>year;
if(CheckDate(day,mounth,year)) cout<<"TRUE"<<endl;
else cout<<"FALSE"<<endl;
system("pause");
return 0;
Вроде бы вот так.
#include <iostream>
using namespace std;
bool CheckDate(int d, int m, int y)
{
return d>0 && d<=31 && m>0 && m<=12 && y>0 ;
}
int main()
{
int day,mounth,year;
cin>>day>>mounth>>year;
if(CheckDate(day,mounth,year)) cout<<"TRUE"<<endl;
else cout<<"FALSE"<<endl;
system("pause");
return 0;
}
Вроде бы вот так.