Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Se citesc notele a n elevi la extemporal. Sa se afiseze care este nota maxima la test si de catre cati elevi a fost obtinuta.
- #include <stdio.h>
- #include <conio.h>
- void main(){
- int i,n,max = 0, nota = 0, last_max = 0, contor = 1;
- printf("Numarul de elevi: "); scanf("%d", &n);
- for(i = 1; i <= n; i++){
- printf("Nota %d = ", i); scanf("%d", ¬a);
- if(nota >= last_max){
- last_max = nota;
- if(last_max > max){
- last_max = max;
- max = nota;
- }else if(last_max == max){
- contor++;
- }
- }
- }
- printf("Nota maxima este %d, obtinuta de %d elevi.", max, contor);
- }
Advertisement
Add Comment
Please, Sign In to add comment