View difference between Paste ID: UbvceWTi and JatcBgYc
SHOW: | | - or go back to the newest paste.
1
#include <iostream>
2
#include <math.h>
3
#include <iomanip>
4
5
using namespace std;
6
7
int main(){
8-
	cout << "Program 2 | Veljko Kovacevic IV3" << endl;
8+
	int a[30][15];
9-
    int n, br = 0;
9+
    int u,p,nedovoljni = 0;
10-
    cin >> n;
10+
    cout << "Program 4 | Veljko Kovacevic IV3" << endl;
11-
    int starost[n];
11+
    cout << "Broj ucenika: ";
12-
    for (int i = 0; i < n; i++){
12+
    cin >> u;
13-
        cout << "Ucenik " << i << " : ";
13+
    cout << "Broj predmeta: ";
14-
        cin >> starost[i];
14+
    cin >> p;
15-
        if(starost[i] >= 18) br++;
15+
16
17-
    cout << "Ima " << br << " punoletnih";
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
}