Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int arr[1000],n,data,j=0;
- int* deletekorbo()
- {
- static int new_arr[1000];
- for(int i=0;i<n;i++)
- {
- if(arr[i]==data)
- continue;
- else
- {
- new_arr[j]=arr[i];
- j++;
- }
- }
- return new_arr;
- }
- int main()
- {
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- cin >> n;
- for(int i=0;i<n;i++)
- cin >> arr[i];
- cin >> data;
- int* ptr = deletekorbo();
- for(int i=0;i<j;i++)
- cout << ptr[i] << ' ';
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment