Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. int main (){
  5.  
  6. int x = 0;
  7.  
  8. ifstream fin;
  9. fin.open ("a.txt");
  10.     if (!file){
  11.     std::cout<<"error while opening the file"<<endl;
  12.           }
  13.  
  14.     while (!file.eof()){
  15.         if (fin.get() == static_cast <int> ('e')){
  16.             x++
  17.             }
  18.             }
  19.  
  20. std::cout<<"x"<<endl;
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement