ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1011. Conductors

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