86求看

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

jfy2204 @ 2023-06-18 15:16:56


#include<bits/stdc++.h>
using namespace std;
const double pi=3.141593;
int main() {
    int T;
    cin >> T;
    if (T == 1) {
        cout << "I love Luogu!";
    } else if (T == 2) {
        cout << 2 + 4 << " " << 10 - 2 - 4;
    } else if (T == 3) {
        cout<<3<<endl;
        cout<<12<<endl;
        cout<<2;
    } else if (T == 4) {
        cout<<166.667;
    } else if (T == 5) {
        cout<<(260+220)/(12+20);
    } else if (T == 6) {
        cout<<sqrt(pow(6,2)+pow(9,2));
    } else if (T == 7) {
        cout<<110<<endl;
        cout<<90<<endl;
        cout<<0;
    } else if (T == 8) {
        cout<<pi*10<<endl;
        cout<<pi*25<<endl;
        cout<<(4/3*1.0)*pi*125;
    } else if (T == 9) {
        cout<<22;
    } else if (T == 10) {
        cout<<9;
    } else if (T == 11) {
        cout<<1.0*100/3;
    } else if (T == 12) {
        cout<<13<<endl;
        cout<<"R";
    } else if (T == 13) {
        cout<<(int)(pow(4/3*pi*(4*4*4+10*10*10),1.0*1/3));
    } else if (T == 14) {
        cout<<50;
    }
    return 0;
}

by jfy2204 @ 2023-06-18 15:17:55

8和13WA了


by jfy2204 @ 2023-06-18 15:19:29

else if (T == 8) {
        cout<<pi*10<<endl;
        cout<<pi*25<<endl;
        cout<<(4/3*1.0)*pi*125;
}

else if (T == 13) {
    cout<<(int(pow(4/3*pi(4*4*4+10*10*10),1.0*1/3));
    }

by zhouzihe @ 2023-06-18 15:29:36

@jfy2204
cout<<(4/3*1.0)*pi*125;改为cout<<4.0/3.0*pi*125;
cout<<(int)(pow(4/3*pi*(4*4*4+10*10*10),1.0*1/3));该为cout<<(int)(pow(4.0/3.0*pi*(4*4*4+10*10*10),1.0*1/3));即可

求关


by jfy2204 @ 2023-06-18 15:31:37

谢谢大佬!
求关?没问题啊!


by yaowang_sunwukong @ 2023-08-11 13:49:05

你这个感觉不严谨


|