#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int a[5] = { 1,2,-1,3,5 }; vector<int>num(a, a + 5); int tar; cin >> tar; cout << distance(num.begin(), remove(num.begin(), num.end(), tar)); system("pause"); return 0; }
时间: 2024-10-08 09:04:03