80求助

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

YZHM @ 2023-11-27 22:10:34

#include <bits/stdc++.h>
using namespace std;

int main(){
    long long a;
    char x,y;
    cin >>a >>x >>y;
    long long ans;
    if((x=='B'&&y=='C') || (x=='C'&&y=='B'))ans=a*6/10;
    else if((x=='B'&&y=='A') ||(x=='A'&&y=='B'))ans=a*8/10;
    else if((x=='C'&&y=='A') ||(x=='A'&&y=='C'))ans=a*7/10;
    else ans=a;
    cout <<ans;
    return 0;
}

by wangn121 @ 2023-12-19 22:17:34

题目说了,可能点一样的菜,所以可能是AA,BB,CC


by YZHM @ 2023-12-28 13:10:14

@wangn121 谢谢,已AC!


|