Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <cstdio>
- using namespace std;
- int main(int argc, char** argv) {
- char c;
- int valor,verifF,dd,mm,aa;
- scanf("%d\n",&valor);
- while (1){
- verifF = scanf("%d/%d/%d",&dd,&mm,&aa);
- if (verifF == EOF) break;
- if (verifF == 0){
- while (1){
- c = getchar();
- if (c == ',') break;
- if (valor == 1) putchar(c);
- } getchar();
- while (1){
- c = getchar();
- if (c == ',') break;
- if (valor == 2) putchar(c);
- } getchar();
- while (1){
- c = getchar();
- if (c == ':') break;
- if (valor == 3) putchar(c);
- }
- printf("\n"); getchar();
- }
- //printf("\t\t\tFecha\t\tHora Inicio\tHora Fin\t\tCantidad de lluvia\n");
- if (verifF>=1){
- if (verifF == 1){ aa=dd; mm=1; dd=1; verifF=3; }
- if (verifF == 2){ aa=mm; mm=dd;dd=1; verifF=3; }
- if (verifF == 3) printf("\t%d/%d/%d",dd,mm,aa);
- int hIni=0,hFin=0,mIni=0,mFin=0,sIni=0,sFin=0;
- scanf("%d:%d:%d",&hIni,&mIni,&sIni);
- scanf("%d:%d:%d",&hFin,&mFin,&sFin);
- printf("\t%02d:%02d:%02d",hIni,mIni,sIni);
- printf("\t%02d:%02d:%02d",hFin,mFin,sFin);
- double cant;
- scanf("%lf",&cant); printf("\t%2.4lf\n",cant);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement