#include<stdio.h>
int main( void ) {
int n;
printf ( "Quantas vezes o programa deve ser executado:" ) ; for ( int i = 1 ; i <= n; i++ ) {
int d1;
int d2;
int h1;
int h2;
int m1;
printf ( "Numero de minutos 1:" ) ; int m2;
printf ( "Numero de minutos 2:" ) ; int dias = d1 + d2;
int horas = h1 + h2;
int minutos = m1 + m2;
horas += minutos / 60 ;
minutos %= 60 ;
dias += horas / 24 ;
horas %= 24 ;
printf ( "%2u Dias %2u Horas %2u Minutos mais\n " , d1
, h1
, m1
) ; printf ( "%2u Dias %2u Horas %2u Minutos\n " , d2
, h2
, m2
) ; printf ( "eh igual a %2u Dias %2u Horas %2u Minutos\n \n " , dias
, horas
, minutos
) ; }
}
//https://pt.stackoverflow.com/q/133429/101
I2luY2x1ZGU8c3RkaW8uaD4KCmludCBtYWluKHZvaWQpIHsKCWludCBuOwoJcHJpbnRmKCJRdWFudGFzIHZlemVzIG8gcHJvZ3JhbWEgZGV2ZSBzZXIgZXhlY3V0YWRvOiIpOwoJc2NhbmYoIiVkIiwgJm4pOwoJZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKSB7CgkJaW50IGQxOwoJCXByaW50ZigiTnVtZXJvIGRlIGRpYXMgMToiKTsKCQlzY2FuZigiJWQiLCAmZDEpOwoJCWludCBkMjsKCQlwcmludGYoIk51bWVybyBkZSBkaWFzIDI6Iik7CgkJc2NhbmYoIiVkIiwgJmQyKTsKCQlpbnQgaDE7CgkJcHJpbnRmKCJOdW1lcm8gZGUgaG9yYXMgMToiKTsKCQlzY2FuZigiJWQiLCAmaDEpOwoJCWludCBoMjsKCQlwcmludGYoIk51bWVybyBkZSBob3JhcyAyOiIpOwoJCXNjYW5mKCIlZCIsICZoMik7CgkJaW50IG0xOwoJCXByaW50ZigiTnVtZXJvIGRlIG1pbnV0b3MgMToiKTsKCQlzY2FuZigiJWQiLCAmbTEpOwoJCWludCBtMjsKCQlwcmludGYoIk51bWVybyBkZSBtaW51dG9zIDI6Iik7CgkJc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