Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- struct ucenik {
- char ime[50], prezime[50];
- int godini;
- int ocenki[10];
- };
- double prosek(struct ucenik u) {
- double suma = 0.0;
- for(int i = 0; i < 10; i++) {
- suma += u.ocenki[i];
- }
- suma /= 10.0;
- return suma;
- }
- int main() {
- struct ucenik u;
- scanf("%s%s%d", u.ime, u.prezime, &u.godini);
- for(int i = 0; i < 10; i++) {
- scanf("%d", &u.ocenki[i]);
- }
- printf("%.2lf\n", prosek(u));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement