fpsplayer @ 2024-11-05 13:29:05
#include<bits/stdc++.h>
using namespace std;
void bobb(int n[],int o)
{
for(int i=0;i<o-1;i++){
for(int j=0;j<o-i-1;j++){
int mid;
if(n[j]>n[j+1]){
mid=n[j];
n[j]=n[j+1];
n[j+1]=mid;
}
}
}
}
int main(){
int sum[3],a,b,c;
char k[3];
for(int i=0;i<3;i++){
scanf("%d",&sum[i]);
}
scanf("%s",&k);
bobb(sum,3);
for(int i=0;i<3;i++){
switch(k[i]){
case 'A':
printf("%d ",sum[0]);
break;
case 'B':
printf("%d ",sum[1]);
break;
case 'C':
printf("%d ",sum[2]);
break;
}
}
return 0;
}
为什么样例都过了,测试出来的是零分啊,疯了
by timetinker @ 2024-11-11 19:44:46
我也是,题解大佬说两次输入中间加两个(没错就是两个)getchar()这样本地输出是错的但是网站全ac了,很奇怪,我也是萌新。
by xuxingcheng @ 2024-11-19 19:37:01
@fpsplayer 题解:
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
int a1=min(min(a,b),c);
int c1=max(max(a,b),c);
int b1=(a+b+c)-(a1+c1);
string d;
cin>>d;
for(int i=0;i<d.size();i++){
if(d[i]=='A'){
cout<<a1<<" ";
}
if(d[i]=='B'){
cout<<b1<<" ";
}
if(d[i]=='C'){
cout<<c1<<" ";
}
}
return 0;
}
by fpsplayer @ 2024-11-25 17:56:18
@timetinker奇怪了,ac的