SHARE
TWEET

Untitled

a guest Sep 30th, 2018 125 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int v[10];
  6. int main() {
  7.  
  8.     ifstream f("numere.txt");
  9.     int n;
  10.  
  11.     while (f >> n) {
  12.  
  13.         while (n > 0) {
  14.             v[n % 10]++;
  15.             n = n / 10;
  16.         }
  17.     }
  18.  
  19.     for (int i = 0; i < 10; i++)
  20.         if (v[i] == 1)
  21.             cout << i << " ";
  22.  
  23.  
  24.  
  25.  
  26.     return 0;
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top