@root

tctm169 我以逍遥醉人间 2024-09-02 9:33:20 4

#include <bits/stdc++.h> #include #include #include #include #include #include #include using namespace std; int n, m; int a[25]; int mi, f; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); } scanf("%d", &m); for (int i = 1; i <= n; i++) { if (a[i] == m) { f = 1; mi = i + 1; break; } else { cout << a[i] << " "; } } for (int i = mi; i <= n; i++) { if (f == 1) cout << a[i] << " "; } }

{{ vote && vote.total.up }}