Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<algorithm>
- #include<string>
- using namespace std;
- int main() {
- string str;
- bool pr = 0;
- int N[10] = { 0 };
- getline(cin, str);
- for (int i = 0; i < str.size(); i++) {
- if (str.at(i) >= 48 && str.at(i) <= 57) {
- N[str[i] - 48]++;
- }
- }
- for (int i = 0; i < 10; i++) {
- if (N[i] != 0) {
- cout << i;
- pr = 1;
- }
- }
- if (pr == 0) {
- cout << "NO";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement