80分求解,有什么逻辑漏洞吗?
查看原帖
80分求解,有什么逻辑漏洞吗?
985463
kunny67楼主2024/3/10 10:02
#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;
	}
}
2024/3/10 10:02
加载中...