why it is wrong answer???sad...
Posted by
xinxin 16 Sep 2016 20:04
#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c,d,i,t;
scanf("%d %d %d %d",&a,&b,&c,&d);
for(i=1;i<10000;i++)
{
a=a+b;
if(a>c)
{
t=c;
break;
}
c=c-d;
if(a>=c)
{
t=a;
break;
}
}
printf("%d",t);
return 0;
}