Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <stdio.h>
- #include <cstdlib>
- #include <ctype.h>
- using namespace std;
- int main()
- {
- char s[11];
- cin >> s;
- int n = strlen(s), ok = 1;
- for (int i = 0; i < n; i++)
- {
- if (!isdigit(s[i]))
- {
- if (s[i] == '.' && i != n - 4)
- ok = 0;
- else if (s[i] != '.')
- ok = 0;
- }
- }
- if (s[n - 4] != '.')
- ok = 0;
- if (ok)
- cout << s << " e numar";
- else
- cout << s << " nu e numar";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement