fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <fstream>
  4. #include <string>
  5. using namespace std;
  6.  
  7. void apaga_espaco(ifstream& tabe) {
  8. string s;
  9. char N;
  10. while (tabe.good()) {
  11. getline(tabe, s);
  12. s.erase(0, 29);
  13. N = s.find(':');
  14. s.erase(0, N + 6);
  15. }
  16. }
  17.  
  18. int main() {
  19. ifstream tabe;
  20. char N;
  21.  
  22. tabe.open("Tabela.txt", ios::in);
  23. if (!tabe.is_open()) {
  24. cout << "Arquivo nao encontrado, erro fatal!";
  25. exit(1);
  26. }
  27. apaga_espaco(tabe);
  28. }
Runtime error #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
Arquivo nao encontrado, erro fatal!