Advertisement
BrokeMansPC

Program 4 - 4.12.2020

Dec 4th, 2020
902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <math.h>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.     int a[30][15];
  9.     int u,p,nedovoljni = 0;
  10.     cout << "Program 4 | Veljko Kovacevic IV3" << endl;
  11.     cout << "Broj ucenika: ";
  12.     cin >> u;
  13.     cout << "Broj predmeta: ";
  14.     cin >> p;
  15.  
  16.  
  17.     for (int i = 0; i < u; i++)
  18.         for (int j = 0; j < p; j++) {
  19.             cout << "Ucenik " << i << " Predmet " << j << " : ";
  20.             cin >> a[i][j];
  21.             if (a[i][j] == 1) nedovoljni++;
  22.         }
  23.  
  24.     cout << endl;
  25.  
  26.     for (int i = 0; i < u; i++) {
  27.         cout << "Ucenik " << i << " - ";
  28.             for (int j = 0; j < p; j++)
  29.                 cout << a[i][j] << " ";
  30.         cout << endl;
  31.     }
  32.  
  33.     cout << "Ima " << nedovoljni << " nedovoljnih.";
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement