why i get WA, help me pls // thanks
Posted by 
PPJ 11 Nov 2002 16:47
this is my code
 
#include <stdio.h>
#include <math.h>
int main(void){
  FILE *fi=stdin,*fo=stdout;
  float p,q,pp,qq;
  int i,ceilp,floorq;
  fscanf(fi,"%f\n%f",&p,&q);
  p/=100;
  q/=100;
  for(i=1;i<30000;i++){
    pp=p*(float)i;
    qq=q*(float)i;
    ceilp=ceil(pp);
    floorq=floor(qq);
    if(ceilp<=floorq)
      break;
  }
  fprintf(fo,"%d\n",i);
  return fclose(fi)+fclose(fo);
}