这题真TM绝!

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

FJ_00460 @ 2023-05-13 18:30:31

我WA了,附赠代码!大佬救命!!!

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

by yeqiwei @ 2023-05-13 19:31:45

第四个问题同第二个:

    if(a == 13)cout<<(int)(pow(4.0 / 3 * pi * (4 * 4 * 4 + 10 * 10 * 10), 1.0 * 1 / 3));

没了,有问题私信我。 @water8424


by Yizhihuaji @ 2023-05-22 09:20:07

这题最tm绝的是每个答案都要求保留六位有效数字,但题目里通篇没提


by kkkkld @ 2023-07-23 20:03:45

@Yizhihuaji 不是吧


by kuailehaoge2024 @ 2023-07-25 17:45:40

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    double q=3.141593;
    if(n==1)cout<<"I love Luogu!";
    if(n==2)cout<<"6 4";
    if(n==3)cout<<"3"<<endl<<"12"<<endl<<"2";
    if(n==4)cout<<setprecision(6)<<500/3.0;
    if(n==5)cout<<"15";
    if(n==6)cout<<sqrt(36+81);
    if(n==7)cout<<"110"<<endl<<"90"<<endl<<"0";
    if(n==8)cout<<10*q<<endl<<25*q<<endl<<250*q/3*2;
    if(n==9)cout<<"22";
    if(n==10)cout<<"9";
    if(n==11)cout<<100/3.0;
    if(n==12)cout<<"13"<<endl<<"R";
    if(n==13)cout<<16;
    if(n==14)cout<<"50";
    return 0;
}

by Yizhihuaji @ 2023-07-26 11:54:54

@Wonderful_Answer_WA 你可以自己试试(


上一页 |