2 条题解

  • 4
    @ 2025-7-16 9:22:49
    #include<bits/stdc++.h> 
    using namespace std; 
    int a[3]; 
    string s; 
    int main() { 
        cin >> a[0] >> a[1] >> a[2] >> s; 
        sort(a, a + 3); 
        for (int i = 0; i < 3; i ++) { 
            if (s[i] == 'A')cout << a[0] << " "; 
            else if (s[i] == 'B')cout << a[1] << " "; 
            else if (s[i] == 'C')cout << a[2] << " "; 
        } 
        return 0; 
    }
    
    • -3

      #include<bits/stdc++.h> using namespace std; int a[3]; string s; int main() { cin >> a[0] >> a[1] >> a[2] >> s; sort(a, a + 3); for (int i = 0; i < 3; i ++) { if (s[i] == 'A')cout << a[0] << " "; else if (s[i] == 'B')cout << a[1] << " "; else if (s[i] == 'C')cout << a[2] << " "; } return 0; }

      • 1

      信息

      ID
      8441
      时间
      1000ms
      内存
      125MiB
      难度
      1
      标签
      递交数
      31
      已通过
      25
      上传者