Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- #include <list>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int* mae = new int[n];
- int maie_cnt = 0;
- for (int tshirt, i = 0; i < n; i++) {
- cin >> tshirt;
- if (i != 0) cout << ' ';
- bool found = false;
- for (int j = 0; j < maie_cnt; j++) {
- if (mae[j] == tshirt) {
- found = true;
- break;
- }
- }
- if (!found) {
- mae[mae_cnt] = tshirt;
- mae_cnt++;
- }
- cout << (int)(!found);
- }
- cout << endl;
- delete[] mae;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement