Saturday, March 18, 2017

URI problem 1160 solution in C | (Population Increase)

Please visit this link to find the solutions-

Link:https://codespathshala.com/uri-1160/



/

1 comment:

  1. why this program is showing LTE error..??

    #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;
    }

    ReplyDelete