Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <cstdlib>
  5. #include <cctype>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. const int max = 20;
  11. int i;
  12. char buffer[max],k;
  13. ifstream in("test.txt");
  14. while (!in.eof())
  15. {
  16. in.getline(buffer, max);
  17. cout << buffer << endl;
  18. }
  19. for (i = 0; i < max; i++)
  20. if (isdigit(buffer[i])) k = buffer[i];
  21. cout << k << endl;
  22. system("pause");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement