30分蒟蒻求助

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

zhangmuxinzhe @ 2023-07-31 15:49:01

#include<iostream>
using namespace  std;
int main(){
    double money;
    int a=0,b=0,c=0;
    char m,n;
    cin>>money>>m>>n;
    if(m=='A') a+=1;
    if(m=='B') b+=1;
    if(m=='C') c+=1;
    if(n=='A') a+=1;
    if(n=='B') b+=1;
    if(n=='C') c+=1;
    if(b>=1&&c==0) money=money*8/10;
    else if(b==0&&c>=1) money=money*7/10;
    else if(b==1&&c==1) money=money*6/10;
    cout<<money;
    return 0;
}

by zhangmuxinzhe @ 2023-08-10 09:20:40

1


by zhangmuxinzhe @ 2023-08-10 09:20:49

1


|