回复 10楼 jklqwe111
程序代码:
#include <stdio.h>
#include <math.h>
#define EPS 0.000001
#define EQ(x, v) (v < x + EPS && x < v + EPS)
#define P 1.9
#define Q 2.3
#define M 82.3
int main(void) {
int i = 0;
double s = P + Q, t = 0;
while((t = M - ++i * s) > 0)
if(EQ(fmod(t, P), 0.0)) printf("%d\n", i);
return 0;
}

Only the Code Tells the Truth K.I.S.S




学习