Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int validacion_fecha(FECHA fecha1){
- if(fecha1.anio<1920||fecha1.anio>2018){
- return 0;
- }else{
- if(fecha1.mes<1||fecha1.mes>12){
- return 0;
- }else{
- if(fecha1.mes==1||fecha1.mes==3||fecha1.mes==5||fecha1.mes==7||fecha1.mes==8||fecha1.mes==10||fecha1.mes==12){
- if(fecha1.dia<1||fecha1.dia>31){
- return 0;
- }
- }else{
- if(fecha1.mes==4||fecha1.mes==6||fecha1.mes==9||fecha1.mes==11){
- if(fecha1.dia<1||fecha1.dia>30){
- return 0;
- }
- }else{
- if(fecha1.anio%100==0&&fecha1.anio%400==0){
- if(fecha1.dia<1||fecha1.dia>29){
- return 0;
- }
- }else{
- if(fecha1.dia<1||fecha1.dia>28){
- return 0;
- }
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement