Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement