Пример за работа со СТРУКТУРИ#include <iostream>#include <cstdlib> #include <string> using namespace std; struct ucenik { string ime; float prosek; }; int main() { ucenik klas[30]; int n; cout<<"Broj na ucenici"<<endl; cin>>n; for (int i=0;i<=n;i++) { cout<<"Vnesete ime "<<endl; cin>>klas[i].ime; cout<<"Vnesete prosek "<<endl; cin>>klas[i].prosek; } for (int i=0;i<=n;i++) { cout<<"Ucenikot so ime "<<endl; cout<<klas[i].ime; cout<<"Ima prosek "<<endl; cout<<klas[i].prosek; } system("PAUSE"); return 0; } |