2 条题解

  • 0
    @ 2026-7-10 16:23:12
    #include <bits/stdc++.h>
    using namespace std;
    
    int main() {
    	int n, a[210];
    	cin >> n;
    	for (int i = 1; i <= n; ++i) {
    		cin >> a[i];
    	}
    	int b = 2;
    
    	for (int i = 1; i <= n; ++i) {
    		if (a[i] < a[b]) {
    			b = i;
    		}
    	}
    	cout << b << "\n";
    	swap(a[1], a[b]);
    
    	for (int i = 1; i <= n; ++i) {
    		cout << a[i] << " ";
    	}
    	return 0;
    }
    
    • -1
      @ 2026-6-12 13:20:00

      #include <bits/stdc++.h> using namespace std;

      int main () { cout << "I LOVE OI."; return 0; }

      • 1

      信息

      ID
      29924
      时间
      1000ms
      内存
      256MiB
      难度
      1
      标签
      递交数
      143
      已通过
      112
      上传者