Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- int main (){
- int x = 0;
- ifstream fin;
- fin.open ("a.txt");
- if (!file){
- std::cout<<"error while opening the file"<<endl;
- }
- while (!file.eof()){
- if (fin.get() == static_cast <int> ('e')){
- x++
- }
- }
- std::cout<<"x"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement