Advertisement
TareSedam

Untitled

Feb 11th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. const int red = 5;//student
  4. const int kol = 4;//predmjet
  5. //polje je ocjena
  6. void Unos(int niz[][4]) {
  7. for (int i = 0; i < red; i++)
  8. {
  9. cout << i << " student: " << endl;
  10. for (int j = 0; j < kol; j++)
  11. {
  12. cin >> niz[i][j];
  13. if (niz[i][j] < 6 || niz[i][j]>10)
  14. --j;
  15. }
  16. }
  17. }
  18. int Prebroji(int niz[][4], int temp) {
  19. int brojac = 0;
  20. for (int i = 0; i < red; i++)
  21. {
  22. if (niz[i][temp] >= 8)
  23. brojac++;
  24. }
  25. return brojac;
  26. }
  27.  
  28. void main() {
  29. int niz[red][kol];
  30. int temp;
  31. Unos(niz);
  32. cout << "Koji predmet?" << endl;
  33. cin >> temp;
  34. cout << "Ima ih: " << Prebroji(niz, temp) << endl;
  35. for (int i = 0; i < red; i++)
  36. {
  37.  
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement