Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- main()
- {
- int n,ocjena,i;
- int j,b,c,zbir;
- string ime[30],prezime[30];
- float a[100];
- cout<<"Unesite broj ucenika koji su radili test"<<endl;
- bu:cin>>n;
- if(n<=30)
- {
- for(i=0;i<n;i++)
- {
- cout<<"Unesite ime"<<endl;
- cin>>ime[i];
- cout<<"Unesite prezime"<<endl;
- cin>>prezime[i];
- cout<<"Unesite ocjenu"<<endl;
- j:cin>>j;
- if((j<0)&&(j>5))
- {
- goto j;
- }
- cout<<"Unesite ocjenu"<<endl;
- b:cin>>b;
- if((b<0)&&(b>5))
- {
- goto b;
- }
- cout<<"Unesite ocjenu"<<endl;
- c:cin>>c;
- if((c<0)&&(c>5))
- {
- goto c;
- }
- zbir=j+b+c;
- a[i]=(float)zbir/3;
- }
- }
- else
- {
- goto bu;
- }
- for(i=0;i<n;i++)
- {
- cout<<ime[i] << prezime[i]<<"\t"<<"Prosjecna ocjena: "<< a[i]<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement