Seal_of_approval

2p55

Dec 7th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5. int main (void)
  6. {
  7. ifstream ins("input.txt");
  8. string S;
  9. int k=0;
  10. while (getline(ins,S))
  11. if (S[0]==S[S.size()-1])
  12. k++;
  13. cout << k << endl;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment