antonio-abrantes
6/27/2016 - 11:11 PM

Uri 2033 - (WA 70%)

Uri 2033 - (WA 70%)

/*  Juros Sobre o Empréstimo - Problemas nº 2033 - Matematica
  https://www.urionlinejudge.com.br/judge/pt/problems/view/2033
  Problema com Wrong answer (70%) */  

#include <stdio.h>
#include <math.h>

int main()
{
	int tempo;
	double capital, juroSimples, juroCompos, diferenca, expo, txJuros;
	
	while(scanf("%lf", &capital) != EOF)
	{
		scanf("%lf", &txJuros);
		scanf("%d", &tempo);
		
		juroSimples = capital * txJuros * tempo;
		expo = pow(1 + txJuros, tempo);
		
		juroCompos = (capital * expo) - capital;
		diferenca = juroCompos - juroSimples;
				
		printf("DIFEREN%cA DE VALOR = %.2lf\n", 128, diferenca);
		printf("JUROS SIMPLES = %.2lf\n", juroSimples);
		printf("JUROS COMPOSTO = %.2lf\n\n", juroCompos);
		
	}
		
	return 0;
}