zzx20120619 @ 2024-10-22 13:52:16
代码:
#include<bits/stdc++.h>
using namespace std;
long long n;
int main(){
cin>>n;
string a;
cin>>a;
if(a[0]=='B'&&a[1]!='C'||a[1]=='B'&&a[0]!='C'){
cout<<n/10*8;
}else if(a[0]!='B'&&a[1]=='C'||a[1]!='B'&&a[0]=='C'){
cout<<n/10*7;
}else if(a[0]=='B'&&a[1]=='C'||a[1]=='B'&&a[0]=='C'){
cout<<n/10*6;
}else{
cout<<n;
}
return 0;
}
by HerobrinePerssonZ @ 2024-11-23 20:55:13
@zzx20120619
#include<bits/stdc++.h>
using namespace std;
string ask[9]={"AA","AB","AC","BA","BB","BC","CA","CB","CC"};
int ans[9]={10,8,7,8,8,6,7,6,7};
unsigned long long a;
string s;
int check(string x)
{
for(int i=0;i<=8;i++)
if(ask[i]==x)
return ans[i];
}
int main()
{
cin >> a >> s;
cout << a/10*check(s);
return 0;
}
你能加团or关注吗?
by ma_rui @ 2024-12-09 21:57:28
呵呵
AC代码
#include<bits/stdc++.h>
using namespace std;
long long n;
char a[3];
bool b,c;
int main()
{
cin>>n;
for(int i=1;i<=2;i++){
cin>>a[i];
if(a[i]=='B')b = 1;
if(a[i]=='C')c = 1;
}
if(!b&&!c)cout<<n;
else if(b&&!c)cout<<n/10*8;
else if(c&&!b)cout<<n/10*7;
else cout<<n/10*6;
return 0;
}