Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <fstream>
  2.  
  3.  
  4. int main()
  5. {
  6.  
  7. ofstream odczyt;
  8. odczyt.open("dane_4.txt");
  9.  
  10. ifstream wpis;
  11. wpis.open("wynik.txt";
  12.  
  13. int pakiety;
  14.  
  15. pakiety << odczyt;
  16.  
  17. for(int i = 0;i<pakiety;i++)
  18. {
  19. int podstawa;
  20. int wyk;
  21. podstawa << odczyt;
  22. wyk << odczyt;
  23. int wynik = podstawa;
  24. for(int x = 0;x<wyk-1;x++)
  25. wynik *= podstawa;
  26. if(wyk==0)
  27. wynik=0;
  28. wpis << wynik << " ";
  29. }
  30. odczyt.close();
  31. wpis.close();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement