Advertisement
Guest User

pole\

a guest
Nov 27th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. // pole.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. using namespace std;
  7.  
  8.  
  9. int _tmain(int argc, _TCHAR* argv[])
  10. {
  11. const int N = 10;
  12. int pole[N];
  13.  
  14. cout << "zadajte cisla do pola: \n";
  15. for (int i=0; i<N; i++)
  16. cin >> pole[i];
  17.  
  18. cout <<"\nObsah pola pod seba:\n";
  19. for (int i=0; i<N; i++)
  20. cout << pole[i] << ", ";
  21. cout << endl;
  22.  
  23. cout <<"\nObsah pola vedla seba:\n";
  24. for (int i=0; i<N; i++)
  25. cout << pole[i] << "\n";
  26. cout << endl;
  27.  
  28. cout <<"\nObsah pola v opacnom poradi:\n";
  29. for (int i=N; i>=0; i--)
  30. cout << pole[N-1-i] << ", ";
  31. cout << endl;
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement