Lp

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Lp as PDF for free.

More details

  • Words: 377
  • Pages: 3
While ( (c=getchar())!=EOF ) { Switch (estado) { Case TEXTO : nCarEval=nSlash=0; if isdigit(c) { num = c – ‘0’; nCarEval ++; Estado = NUM ; } Break; Case NUM : if ( c==BLANCO || c== TAB || c==EOLN ) { if (nSlash==2 ) && (nCarEval ==4) { agno = num; if FechaCorrecta(dia,mes,agno) EscribeFecha(agno,mes,dia); else EscribeFecha(dia,mes,agno); } estado= TEXTO ;

//para el sgte o en error

} else {

If isdigit(c) { num=num*10 + (c – ‘0’); nCarEval ++; } else if ( c==’/’ ) && nCarEval ==4 && nSlash==0 { agno = num; Estado = MES; } else { EscribeValores(nCarEval,nSlash,num); Putchar(c); estado = TEXTO } }

break; Case MES :

If isdigit(c) { num=num*10 + (c – ‘0’); nCarEval ++; } Else if ( c==’/’ ) && if nSlash==1 && nCarEval ==7 { mes = num; Estado = DIA; }

else { EscribeValores(nCarEval,nSlash,num,dia,mes,agno); Putchar(c); estado = TEXTO } break; Case DIA :

If isdigit(c) { num=num*10 + (c – ‘0’); nCarEval ++; } Else if ( c==’/’ ) && if nSlash==2 && nCarEval ==10 { mes = num; Estado = TEXTO; }

else { EscribeValores(nCarEval,nSlash,num,dia,mes,agno); Putchar(c); estado = TEXTO } break;

} } Else if nSlash==1 && nCarEval ==5 else EscribeValores(nCarEval,nSlash,num,dia,mes,agno); num=0 ; nSlash++; nCarEval ++;

mes = num;

While ( (c=getchar())!=EOF ) { Switch (estado) { Case TEXTO : nCarEval=nSlash=0; if isdigit(c) { num = c – ‘0’; nCarEval ++; Estado = NUM ; } Break; Case NUM : if ( c==BLANCO || c== TAB || c==EOLN ) { if (nSlash==2 ) && (nCarEval ==4) { agno = num; if FechaCorrecta(dia,mes,agno) EscribeFecha(agno,mes,dia); else EscribeFecha(dia,mes,agno); } else { EscribeValores(nCarEval,nSlash,num,dia,mes,agno); Putchar(c); } estado = TEXTO ;

//para el séte, y si ocurrio error

} else {

If isdigit(c) { num=num*10 + (c – ‘0’); nCarEval ++; } else if ( c==’/’ ) && num!=0 && nSlash<=1 { if nSlash==0 && nCarEval ==2 dia = num; Else if nSlash==1 && nCarEval ==5 mes = num; else EscribeValores(nCarEval,nSlash,num,dia,mes,agno);

num=0 ; nSlash++; } else {

nCarEval ++;

EscribeValores(nCarEval,nSlash,num,dia,mes,agno); Putchar(c); estado = TEXTO

} } break; } }

Void EscribeValores(int nCarEval, int nSlash, int num, int dia, int mes, int agno) { if nSlash==0 EscribeNum(num); if nSlash==1 && nCarEval >= 2 EscribeNum(dia); if nSlash==2 && nCarEval >= 5 EscribeNum(mes); }

´

Related Documents

Lp
August 2019 105
Lp
November 2019 101
Lp
May 2020 74
Lp
October 2019 102
Lp
October 2019 96
Lp Pneumoia.docx
December 2019 0