Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
polja_z6.cpp
00001 #include <iostream> 00002 #include <ctime> 00003 #include <cstdlib> 00004 00005 00006 using namespace std; 00007 int brojs = 2; 00008 00009 struct Student { 00010 int jmbag; 00011 char ime[50]; 00012 char prezime[50]; 00013 double prosjek; 00014 }; 00015 00016 int main (){ 00017 00018 struct Student stud[brojs]; 00019 00020 for (int i = 0; i < brojs; i++){ 00021 cout << "Unesi JMBAG za " <<i +1<<". studenta: "; 00022 cout << endl; 00023 cin >> stud[i].jmbag; 00024 cout << "Unesi ime za " <<i +1<<". studenta: "; 00025 cout << endl; 00026 cin >> stud[i].ime; 00027 cout << "Unesi prezime za " <<i +1<<". studenta: "; 00028 cout <<endl; 00029 cin >> stud[i].prezime; 00030 cout << "Unesi prosjek ocjena za " <<i +1<<". studenta: "; 00031 cout <<endl; 00032 cin >> stud[i].prosjek; 00033 } 00034 00035 00036 int jmbag; 00037 int chk = 0; 00038 cout << "Unesi JMBAG studenta: "; 00039 cin >> jmbag; 00040 00041 for (int i = 0; i < brojs; i++){ 00042 if (jmbag == stud[i].jmbag){ 00043 cout << stud[i].ime << endl << stud[i].prezime << endl << "prosijek: " stud[i].prosjek; 00044 chk = 1; 00045 } 00046 00047 00048 } 00049 00050 if (chk == 0) { 00051 cout << endl<< "nrma taki!"; 00052 } 00053 00054 }
Generated on Thu Jul 14 2022 21:05:48 by
1.7.2