什么鬼!这叫入门题!

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

W_churchill @ 2020-05-08 19:33:07

else if (T == 8) 
    {
        cout<<5*2*3.141593<<" ";             
        cout<<5*5*3.141593<<" ";
        cout<<1.0*double(4/3)*3.141593*125.0<<" ";
        return 0;
} 
else if (T == 13) 
{
        int sum=4*4*4*3.141593;
        sum+=10*10*10*3.141593;
        cout<<prime(sum)<<endl;
        return 0;
} 

为什么T8和T13一直过不了啊???
小学生的我太菜了


by W_churchill @ 2020-05-08 19:46:47

@kangjiayuan 样例输出为

31.4159 78.5398 523.599


by 江户川·萝卜 @ 2020-05-08 19:47:26

T13:您的prime函数只能将完全立方数的立方根求出来,建议使用pow(sum,1.0/3)


by kjy_ttcl @ 2020-05-08 19:47:51

谔谔,我用endl过了


by tangrunxi @ 2020-05-08 19:48:02

@Qinclude T84/3改成4.0/3就能过去了


by W_churchill @ 2020-05-08 19:48:06

为什么我的T8自己输出对了,但评测姬说错了


by Callous_Murder @ 2020-05-08 19:50:57

@TLE_er__psz 惊现psz!


by W_churchill @ 2020-05-08 19:53:49

else if (T == 8) 
    {
        cout<<5*2*3.141593;         
    cout<<5*5*3.141593;
    cout<<1.0*double(4.0/3)*3.141593*125.0;
        return 0;
    } 
else if (T == 13) 
    {
        long double sum=4*4*4*3.141593;
        sum+=10*10*10*3.141593;
        cout<<pow(sum,1.0/3)<<endl;
        return 0;
    } 

为什么还是错了qwq


by 江户川·萝卜 @ 2020-05-08 19:56:05

@Qinclude T13要保留整数的啊awa


by Loser_King @ 2020-05-08 19:56:21

@Qinclude #8未按题目要求输出啊


by W_churchill @ 2020-05-08 19:56:28

哪错了???


上一页 | 下一页