Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main()
- {
- string str, s, g;
- ifstream in ("input.txt");
- /*char c;*/
- cout << "Enter letter ";
- cin >> g;
- while (in.peek()!=EOF)
- {
- in >> str;
- if (( str[0] == g[0]) && (str[str.length()] == g[0]))
- s += str + " ";
- }
- cout << s;
- in.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement