#include <stdio.h>
float converterDiasEmAnos( float dias) {
return dias / 365 ;
}
float converterHorasEmDias( int horas) {
return 10000 / horas;
}
int obterMeses( float anos) {
return ( anos - ( int ) anos) / ( 1.0f / 12.0f ) + 1 ;
}
int main( ) {
printf ( "\t Programa para saber quanto demora a tornar-se genio!\n \n " ) ; int num_horas;
printf ( "Quantas horas vai dedicar por dia para ser genio? " ) ; float dias = converterHorasEmDias( num_horas) ;
float anos = converterDiasEmAnos( dias) ;
int meses = obterMeses( anos) ;
printf ( "\n Voce vai demorar %.1f dias, ou seja, aproximadamente %d anos e %d meses para ficar genio" , dias
, ( int ) anos
, meses
) ; return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpmbG9hdCBjb252ZXJ0ZXJEaWFzRW1Bbm9zKGZsb2F0IGRpYXMpIHsKICAgIHJldHVybiBkaWFzIC8gMzY1Owp9CmZsb2F0IGNvbnZlcnRlckhvcmFzRW1EaWFzKGludCBob3JhcykgewogICAgcmV0dXJuIDEwMDAwIC8gaG9yYXM7Cn0KaW50IG9idGVyTWVzZXMoZmxvYXQgYW5vcykgewogICAgcmV0dXJuIChhbm9zIC0gKGludClhbm9zKSAvICgxLjBmIC8gMTIuMGYpICsgMTsKfQppbnQgbWFpbigpIHsKICAgIHByaW50ZigiXHRQcm9ncmFtYSBwYXJhIHNhYmVyIHF1YW50byBkZW1vcmEgYSB0b3JuYXItc2UgZ2VuaW8hXG5cbiIpOwogICAgaW50IG51bV9ob3JhczsKICAgIHByaW50ZigiUXVhbnRhcyBob3JhcyB2YWkgZGVkaWNhciBwb3IgZGlhIHBhcmEgc2VyIGdlbmlvPyAiKTsKICAgIHNjYW5mKCIlZCIsICZudW1faG9yYXMpOwogICAgZmxvYXQgZGlhcyA9IGNvbnZlcnRlckhvcmFzRW1EaWFzKG51bV9ob3Jhcyk7CiAgICBmbG9hdCBhbm9zID0gY29udmVydGVyRGlhc0VtQW5vcyhkaWFzKTsKICAgIGludCBtZXNlcyA9IG9idGVyTWVzZXMoYW5vcyk7CiAgICBwcmludGYoIlxuVm9jZSB2YWkgZGVtb3JhciAlLjFmIGRpYXMsIG91IHNlamEsIGFwcm94aW1hZGFtZW50ZSAlZCBhbm9zIGUgJWQgbWVzZXMgcGFyYSBmaWNhciBnZW5pbyIsIGRpYXMsIChpbnQpYW5vcywgbWVzZXMpOwogICAgcmV0dXJuIDA7Cn0=