Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
715 B
2
Indexable
Never

// Online C++ Compiler - Build, Compile and Run your C++ programs online in your favorite browser

#include<iostream>

using namespace std;

int main()
{
    string uczen[5] = {"Bartek","Adrian","Kinga","Patka","Krzysiu"};
    
    int dziennik[5][3] = {6,6,6,
                          5,6,5,
                          4,3,3,
                          2,1,3,
                          1,1,1};
    
    
    for (int i = 0; i < 5; i++){
        cout<<"Uczen: " << uczen[i];
        cout<<" Oceny: ";
        int suma = 0;
        for(int j = 0; j<3; j++) {
            cout<<dziennik[i][j]<<" ";
            suma+=dziennik[i][j];
        }
        cout<<"Średnia: " << suma/3.0 <<endl;
    }
    

    return 0;
}