Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- struct punkty{
- int indeks, ocena;
- };
- int main()
- {
- int n;
- cout<<"Podaj liczbe studentow:";
- cin>>n;
- punkty tab[n];
- for(int i=0; i<n; i++)
- {
- cout<<"Podaj indeks studenta:";
- cin>>tab[i].indeks;
- cout<<"Podaj ocene studenta:";
- cin>>tab[i].ocena;
- }
- cout<<"Zdali egzamin:"<<endl;
- for(int i=0; i<n; i++)
- {
- if(tab[i].ocena>=3)
- {
- cout<<tab[i].indeks<<endl;
- }
- }
- cout<<"Nie zdali egzaminu:"<<endl;
- for(int i=0; i<n; i++)
- {
- if(tab[i].ocena<3)
- {
- cout<<tab[i].indeks<<endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement