疑问

P2433 【深基1-2】小学数学 N 合一

great_mad @ 2023-11-23 23:07:14

#include<stdio.h>
#include<math.h>
#define PI 3.141593
int main() {
    int T;
    scanf("%d",& T);
    if (T == 1) {
        printf( "I love Luogu!");
    } else if (T == 2) {
        printf("%d %d",2+4,10-2-4);
    } else if (T == 3) {
        printf("%d %d %d",14/4,14-(14%4),14%4);
    } else if (T == 4) {
        printf("%.6f",(float)500/3);
    } else if (T == 5) {
        printf("%d",(260+220)/(20-12));
    } else if (T == 6) {
        printf("%f",sqrt(6*6+9*9));
    } else if (T == 7) {
        printf("%d\n%d\n%d\n",100+10,100+10-20,0);
    } else if (T == 8) {
        printf("%f %f %f",2*5*PI,PI*5*5,(float)4/3*PI*5*5*5);
    } else if (T == 9) {

        printf("%d",22);
    } else if (T == 10) {

        printf("%d",9);
    } else if (T == 11) {
       printf("%f",100.0/3);
    } else if (T == 12) {
       printf("%d %c",'A'-'M'+1,'A'-1+18);
    } else if (T == 13) {
       float v = 4.0/3*PI*(4*4*4+10*10*10);
       printf("%f",pow(v,1.0/3));
    } else if (T == 14) {
        int x,y;
        if((10+x)*(110-x)==3500)
        printf("%d",x);
        if((10-y)*(110+y)==3500)
        printf("%d",y);
        if(110+y<110-x)
        printf("%d",110+y);
        else
        printf("%d",110-x);
    }
    return 0;
}

by great_mad @ 2023-11-23 23:07:47

@great_mad 对了1,2,7,9,10


by George_qwe @ 2023-11-26 14:36:24

用数学直接把答案算出来 四舍五入到6位小数


by jessie_liu @ 2023-12-23 12:34:15

没问题,对的


|