小学六年级求救!

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

lucy2012 @ 2024-02-06 22:08:30

不知道错哪了

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a;
    cin>>a;
    switch (a)
    {
    case 1:
    cout<<"I love Luogu!" ;
    break;
    case 2:
    cout<<2+4<<" "<<10-2-4;
    break;
    case 3:
    cout<<14/4<<endl<<14-14%4<<endl<<14%4;
    break;
    case 4:
    printf("%.3lf",500*1.0/3);
    break;
    case 5:
    cout<<(220+260)/(12+20);
    break;
    case 6:
    cout<<sqrt(6*6+9*9);
    break;
    case 7:
    {int x;
    x=100;
    x+=10;
    cout<<x<<endl;
    x-=20;
    cout<<x<<endl;
    cout<<"0";}
    break;
    case 8:
    cout<<5*2*3.141593<<endl<<5*5*3.141593<<endl<<3.141593*4/3*5*5*5;
    break;
    case 9:
    cout<<(((1+1)*2+1)*2+1)*2;
    break;
    case 10:
    cout<<"9";
    break;
    case 11:
    cout<<100.0/(8-5);
    break;
    case 12:
    {
    cout<<(int)('M'-'A')+1<<endl;
    cout<<(char)('A'+18-1);
    }
    break;
    case 13:
    cout<<(int)(pow(4.0/3*3.141593*(4*4*4+10*10*10),1.0/3));
    case 14:
    cout<<"50";
    break;      
    }
    return 0;

}   

by lucy2012 @ 2024-02-06 22:10:41

wa了13测试点,请大佬指点


by xiaoshumiao @ 2024-02-06 22:11:29

@lucy2012 case 13 结束了后没 break


by lucy2012 @ 2024-02-07 09:09:59

@xiaoshumiao AC了,谢谢!


by guang_zi_guei_ji @ 2024-02-24 11:58:35

@lucy2012 下载数据点吧


|