Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define Line cout << endl << "-------------------------------------------\n\n"
- #define forn(i, n) for(int i = 0; i < int(n);i++)
- const int INF = 1e9 + 13;
- const int N = 1e5 + 13;
- int main(){
- int n, t; cin >> n >> t;
- while(!t){
- cout << "enter another digit/n>";
- cin >> t;
- }
- vector<int> a(n);
- forn(i, n)
- cin >> a[i];
- vector<int>::iterator it;
- forn(i, a.size())
- if (a[i] == t)
- {
- it = a.begin() + i++;
- a.insert(it, 0);
- }
- forn(i, a.size())
- cout << a[i] << ' ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement