Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int n;
- int i;
- int max=0;
- int maxind=0;
- float sumpoeni=0;
- int ocena;
- int brojac=0;
- int brIndeks,LabPoeni,TestPoeni,Kol1Poeni,Kol2Poeni;
- scanf("%d",&n);
- for(i=1;i<=n;i++)
- {
- scanf("%d %d %d %d %d",&brIndeks,&LabPoeni,&TestPoeni,&Kol1Poeni,&Kol2Poeni);
- sumpoeni=0;
- ocena=0;
- sumpoeni=LabPoeni+0.75*TestPoeni+0.35*Kol1Poeni+0.40*Kol2Poeni;
- if(sumpoeni<50)
- ocena=5;
- else if(50<=sumpoeni&&sumpoeni<60)
- ocena=6;
- else if(60<=sumpoeni&&sumpoeni<70)
- ocena=7;
- else if(70<=sumpoeni&&sumpoeni<80)
- ocena=8;
- else if(80<=sumpoeni&&sumpoeni<90)
- ocena=9;
- else if(90<=sumpoeni&&sumpoeni<=100)
- ocena=10;
- if(ocena>5)
- brojac++;
- if(sumpoeni>max)
- {
- max=sumpoeni;
- maxind=brIndeks;
- }
- printf("%d. %d %.2f %d\n",i,brIndeks,sumpoeni,ocena);
- }
- printf("Maksimalni poeni ima studentot: %d\n",maxind);
- printf("Procent na polozeni studenti: %.2f%%\n",((float)brojac/n)*100);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement