Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
72
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.  
  3. using namespace std;
  4. struct mekat {
  5. int vektori[10];
  6. double mesatare1() {
  7. int S = 0;
  8. for (int i = 0; i < 10; i++)
  9. S += vektori[i];
  10. return (double)(S / 10);
  11. }
  12. void mbushVargun() {
  13.  
  14. for (int i = 0; i < 10; i++)
  15. {
  16. cout << "Shkruani antarin e " << i + 1 << ": ";
  17. cin >> vektori[i];
  18. }
  19. }
  20. void shtypantaret() {
  21. for (int i = 0; i < 10; i++)
  22. cout << "Antari i " << i << ": " << vektori[i] << endl;
  23. }
  24. };
  25. int main() {
  26. mekat mekat1;
  27. mekat1.mbushVargun();
  28. mekat1.shtypantaret();
  29. cout << "Mesatarja eshte " << mekat1.mesatare1();
  30. system("pause");
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement