Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <iostream>
- #include <string>
- using namespace std;
- string::size_type find_char(const string &s, char c)
- {
- string::size_type i = 0;
- while(i != s.size() && s[i] != c)
- ++i;
- return i ;
- }
- bool is_sentence(const string &s)
- {
- char b = '.';
- return (find_char(s, b) == s.size() - 1);
- }
- int main()
- {
- string a = "adadadqeqead,";
- is_sentence(a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement