解题思路:
利用数学
参考代码:
#include <stdio.h> int main() { double p, q; while(scanf("%lf %lf", &p, &q) != EOF) { int i = 2; while(1) { if((int)(i*q*0.01)-(int)(i*p*0.01)>=1)//其实就是(int)(i*p*0.01)<(int)(i*q*0.01) { printf("%d\n", i); break; } i++; } } return 0; }
0.0分
0 人评分