0分爆红求助

B2065 鸡尾酒疗法

Ycymax111111 @ 2024-11-18 20:54:55

#include<stdio.h>
#include<math.h>
int main()
{
    int n;
    int i=1;
    scanf("%d\n",&n);
    double a,b,c,d,m;
    scanf("%lf %lf",&a,&b);
    double e;
    m=b/a;//initial treatment
    for(i=1;i<=n-1;i++){
        scanf("%lf %lf",&c,&d);
        e=d/c;//innovative treatment
        if(m-e>0.05){
            printf("worse");
        }else if(e-m>0.05){
            printf("better");
        }else {
            printf("same");
        }
    }

}

|