Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  4. using namespace std;
  5.  
  6.  
  7. int main(int argc, char** argv)
  8. {
  9. int tab[n],n;
  10.  
  11. cout << "Podaj rozmiar tablicy ";
  12. cin >> n;
  13. cout << "Wprowadz liczby do tablicy ";
  14.  
  15. for (int i=0; i<n ; i++)
  16. {
  17. cin >> tab[i];
  18. }
  19.  
  20. for (int i=0; i<n; i++)
  21. {
  22. cout << tab[i];
  23. }
  24.  
  25. cout << endl;
  26.  
  27. for (int i=0; i<(n/2); i++)
  28. {
  29. if(tab[i] == tab[i+(n-i)])
  30. {
  31. cout << "Tablica jest symetryczna " << endl;
  32. }
  33. else
  34. {
  35. cout << "Tablica nie jest symetryczna" << endl;
  36. }
  37. }
  38.  
  39. cout << endl;
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement