Eat - Code - Sleep - Repeat
why this program is showing LTE error..??#includeusing namespace std;int main(){ int i=0,n=0,s,j,a,b; double ga,gb; scanf("%d",&n); for(j=1;j<=n;j++) { scanf("%d %d %lf %lf",&a,&b,&ga,&gb); while(b>=a) { a+=a*ga/100; b+=b*gb/100; i++; } if(i>100) printf("Mais de 1 seculo.\n"); else printf("%d anos.\n",i); i=0; } return 0;}
why this program is showing LTE error..??
ReplyDelete#include
using namespace std;
int main()
{
int i=0,n=0,s,j,a,b;
double ga,gb;
scanf("%d",&n);
for(j=1;j<=n;j++)
{
scanf("%d %d %lf %lf",&a,&b,&ga,&gb);
while(b>=a)
{
a+=a*ga/100;
b+=b*gb/100;
i++;
}
if(i>100)
printf("Mais de 1 seculo.\n");
else
printf("%d anos.\n",i);
i=0;
}
return 0;
}