TOPIC
Wrong aswer 20%,porque?
rspires0 asked 2 years ago
include
int main(){
int a=0,b=0,c=0,d=0;
int e=0,f=0,g=0,h=0;
int t1=0,t2=0,t3=0,t4=0;
int sec1=0,sec2=0,sectotal=0;
printf("Dia\t");
scanf(" %d",&a);
scanf(" %d %d %d",&b,&c,&d);
printf("Dia\t");
scanf(" %d",&e);
scanf(" %d %d %d",&f,&g,&h);
sec1=d+(c*60)+((b*60)*60)+(((a*24)*60)*60);
sec2=h+(g*60)+((f*60)*60)+(((e*24)*60)*60);
sectotal=sec2-sec1;
for(t4=0;t4<sectotal;sectotal--){
t4++;
if(t4>59){
t3++;
t4=0;
}
if(t3>59){
t2++;
t3=0;
}
if(t2>23){
t1++;
t2=0;
}
}
printf("%d dia(s)\n%d hora(s)\n%d minuto(s)\n%d segundo(s)\n",t1,t2,t3,t4);
return 0;
}
saida esta ddiferenteddiferentediferentdiferentddiferenteddiferentediferentdiferent
This topic was solved and cannot recieve new replies.