Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- string s, s1;
- cout << "Nhap xau s: ";
- getline(cin, s);
- for (int i = 0; i < s.size(); i++) {
- if (isdigit(s[i]) && s[i] != '0') s1 += s[i];
- }
- cout << "Xau s1 la: " << s1 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment