80分求解,有什么逻辑漏洞吗?

B3720 [语言月赛202303] Out for Dinner B

kunny67 @ 2024-03-10 10:02:44


#include <iomanip>
#include <math.h>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <map> 
using namespace std;

int main(){
    long long int x;
    char a,b;
    cin>>x>>a>>b;
    if((a=='B'&&b!='C')||(b=='B'&&a!='c')){
        cout<<x/10*8;
    }
    else if((a=='C'&&b!='B')||(b=='C'&&a!='B')){
        cout<<x/10*7;
    }
    else if((a=='B'&&b=='C')||(b=='B'&&a=='C')){
        cout<<x/10*6;
    }
    else{
        cout<<x;
    }
}

by lzy13915136909 @ 2024-03-31 15:13:28

@kunny67 emm...哥们,开double


by Jasondan @ 2024-04-25 20:16:54

AA,BB,CC呢?“这两道菜可能是相同的”


by Chlero @ 2024-05-02 22:43:31

@kunny67

long long int x;
char a,b;
cin>>x>>a>>b;
if((a=='B'&&b!='C')||(b=='B'&&a!='c')){
    cout<<x/10*8;
}

这里'c'打成小写了


|