SHARE
TWEET

Untitled

a guest Apr 19th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<vector>
  3. #include<algorithm>
  4. #include<string>
  5. using namespace std;
  6. int main() {
  7.     string str;
  8.     bool pr = 0;
  9.     int N[10] = { 0 };
  10.     getline(cin, str);
  11.     for (int i = 0; i < str.size(); i++) {
  12.         if (str.at(i) >= 48 && str.at(i) <= 57) {
  13.             N[str[i] - 48]++;
  14.         }
  15.     }
  16.     for (int i = 0; i < 10; i++) {
  17.         if (N[i] != 0) {
  18.             cout << i;
  19.             pr = 1;
  20.         }
  21.     }
  22.     if (pr == 0) {
  23.         cout << "NO";
  24.     }
  25.     return 0;
  26. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top