1 条题解

  • 0
    @ 2025-3-18 7:47:43
    #include<bits/stdc++.h>
    typedef long long ll, LL;
    using namespace std;
    #define pb push_back
    
    void solve() {
    	int a[5], p = -1, flag0=0;
    	for(int i = 0; i < 5; i++) {
    		scanf("%1d", &a[i]);
    		if(a[i]%2==0) {
    			p=i;
    			if(a[i]==0) flag0=1;
    		}
    		
    	}
    	if(p==-1) cout << 97531 << endl;
    	else {
    		for(int i = 0; i < 5; i++){
    			if(i!=p) cout << a[i];
    		}\
    		cout << a[p] << endl;
    	}
    }
    
    int main() {
    //	ios::sync_with_stdio(false);
    	cin.tie(0);
    	cout.tie(0);
    	
    	int t = 1;
    	cin >> t;
        while(t--) {
        	solve();
    	}
    	
    	return 0;
    }
    
    • 1

    信息

    ID
    1656
    时间
    1000ms
    内存
    256MiB
    难度
    7
    标签
    提交数
    42
    已通过
    9
    上传者