Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. void wczytaj (int *T, int n)
  5. {
  6. cout<<"podaj elementy tablicy:"<<endl;
  7. for (int i=0;i<n;i++)
  8. {
  9. cout<<"T["<<i<<"] = ";
  10. cin>>T[i];
  11. }
  12. }
  13. void wypisz (int T[], int n)
  14. {
  15. cout<<"\nwczytana tablica:"<<endl;
  16. for (int i=0;i<n;i++) cout<<setw(7)<<T[i];
  17. cout<<endl;
  18. }
  19. void wypiszOdwrotnie (int T[], int n)
  20. {
  21. cout<<"\nwczytana tablica w odwrotnej kolejnosci:"<<endl;
  22. for (int i=n-1;i>=0;i--) cout<<setw(7)<<T[i];
  23. cout<<endl;
  24. }
  25. int main()
  26. {
  27. int T[8];
  28. wczytaj(T,8);
  29. wypisz(T,8);
  30. wypiszOdwrotnie(T,8);
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement