Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8. ifstream subor;
  9. subor.open("Graf.txt");
  10.  
  11. if (subor.fail()){
  12. cerr << "Subor sa nepodarilo otvorit";
  13. exit(1);
  14. }
  15.  
  16.  
  17. int first;
  18. int second;
  19.  
  20. while (!subor.eof()){
  21. subor >> first;
  22. subor >> second;
  23. cout<<first<<" -> "<<second<<endl;
  24.  
  25.  
  26. }
  27.  
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement