Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main() {
- ifstream fin("input.txt");
- int colors[3]{};
- int size;
- fin >> size;
- int temp;
- for (int i = 0; i < size; i++) {
- fin >> temp;
- colors[temp]++;
- }
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < colors[i]; j++) {
- cout << i << " ";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement