Advertisement
damch

rezultatiprog

Nov 21st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int n;
  7. int i;
  8. int max=0;
  9. int maxind=0;
  10. float sumpoeni=0;
  11. int ocena;
  12. int brojac=0;
  13.  
  14. int brIndeks,LabPoeni,TestPoeni,Kol1Poeni,Kol2Poeni;
  15. scanf("%d",&n);
  16. for(i=1;i<=n;i++)
  17. {
  18. scanf("%d %d %d %d %d",&brIndeks,&LabPoeni,&TestPoeni,&Kol1Poeni,&Kol2Poeni);
  19. sumpoeni=0;
  20. ocena=0;
  21. sumpoeni=LabPoeni+0.75*TestPoeni+0.35*Kol1Poeni+0.40*Kol2Poeni;
  22.  
  23. if(sumpoeni<50)
  24. ocena=5;
  25. else if(50<=sumpoeni&&sumpoeni<60)
  26. ocena=6;
  27. else if(60<=sumpoeni&&sumpoeni<70)
  28. ocena=7;
  29. else if(70<=sumpoeni&&sumpoeni<80)
  30. ocena=8;
  31. else if(80<=sumpoeni&&sumpoeni<90)
  32. ocena=9;
  33. else if(90<=sumpoeni&&sumpoeni<=100)
  34. ocena=10;
  35.  
  36. if(ocena>5)
  37. brojac++;
  38.  
  39. if(sumpoeni>max)
  40. {
  41. max=sumpoeni;
  42. maxind=brIndeks;
  43. }
  44.  
  45. printf("%d. %d %.2f %d\n",i,brIndeks,sumpoeni,ocena);
  46.  
  47.  
  48. }
  49. printf("Maksimalni poeni ima studentot: %d\n",maxind);
  50. printf("Procent na polozeni studenti: %.2f%%\n",((float)brojac/n)*100);
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement