Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. main()
  5. {
  6. int n,ocjena,i;
  7. int j,b,c,zbir;
  8. string ime[30],prezime[30];
  9. float a[100];
  10. cout<<"Unesite broj ucenika koji su radili test"<<endl;
  11. bu:cin>>n;
  12. if(n<=30)
  13. {
  14. for(i=0;i<n;i++)
  15. {
  16. cout<<"Unesite ime"<<endl;
  17. cin>>ime[i];
  18. cout<<"Unesite prezime"<<endl;
  19. cin>>prezime[i];
  20. cout<<"Unesite ocjenu"<<endl;
  21. j:cin>>j;
  22. if((j<0)&&(j>5))
  23. {
  24. goto j;
  25. }
  26. cout<<"Unesite ocjenu"<<endl;
  27. b:cin>>b;
  28. if((b<0)&&(b>5))
  29. {
  30. goto b;
  31. }
  32. cout<<"Unesite ocjenu"<<endl;
  33. c:cin>>c;
  34. if((c<0)&&(c>5))
  35. {
  36. goto c;
  37. }
  38. zbir=j+b+c;
  39. a[i]=(float)zbir/3;
  40. }
  41. }
  42. else
  43. {
  44. goto bu;
  45. }
  46. for(i=0;i<n;i++)
  47. {
  48. cout<<ime[i] << prezime[i]<<"\t"<<"Prosjecna ocjena: "<< a[i]<<endl;
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement