Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <locale>
- #include <set>
- using namespace std;
- ifstream f("input.txt", ios::in);
- ofstream F("output.txt");
- void main(){
- set<int> cifr;
- set<int>::iterator it;
- int n,a,b;
- f >> n;
- for (int i = 0; i < n; i++){
- f >> a;
- while (a > 0){
- b = a % 10;
- cifr.insert(b);
- a /= 10;
- }
- }
- for (it = cifr.begin(); it != cifr.end(); ++it){
- F << *it << " ";
- }
- F << endl;
- cout << endl;
- for (int i = 0; i < 10; i++){
- if (cifr.find(i) == cifr.end()){
- F << i << " ";
- }
- }
- cout << endl;
- F.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment