Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <cstdio>
- using namespace std;
- int main()
- {
- char s[255];
- gets(s);
- int nr = 0, ok = 0;
- for(int i = 0; i <= strlen(s); ++i)
- if(s[i] >= '0' && s[i] <= '9' || s[i] == '.')
- {
- cout << "pasul I" << endl;
- nr++;
- if(s[i] == '.')
- ok = 1;
- }
- else if(s[i] == ' ' || i == strlen(s))
- if(ok)
- {
- cout << "pasul II" << endl;
- strcpy(s + (i - nr), s + i);
- nr = 0;
- ok = 0;
- i = i - nr;
- }
- else
- nr = 0;
- cout << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement