Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int find(char s[], int & i) {
- bool ok = true;
- while (i < strlen(s) && s[i] != ' ')
- if (s[i++] == '.')
- ok = false;
- return ok;
- }
- int main() {
- char s[101], cifre[] = "0123456789";
- cin.getline(s, 101);
- for (int i = 0; i < strlen(s); i++) {
- if (!strchr(cifre, s[i]))
- cout << s[i];
- else {
- int j = i;
- bool ok = find(s, i);
- if (ok) {
- i = j;
- while (s[i] != ' ' && i < strlen(s))
- cout << s[i++];
- i--;
- }
- else
- i--;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement