Advertisement
adnit

Untitled

Dec 6th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7. int n;
  8. cout << "Shtypni numrin e anetareve : ";
  9. cin >> n;
  10.  
  11. int vargu[n];
  12.  
  13. for (int i = 0; i < n; i++)
  14. {
  15. cout << "Shtyp elementin " << i + 1 << ": ";
  16. cin >> vargu[i];
  17. }
  18.  
  19. // antari i mesem
  20. if(n%2 == 0){
  21. cout << "Numri i antareve eshte qift nuk ka antar te mesem";
  22. }
  23. else
  24. {
  25. cout << "Antari i mesem i vargut eshte " << vargu[(n/2)] << endl;
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement