http://cur.lv/4x9e0 (Earn Bitcoins)

// HEADER

#ifndef studentimatricolaesame_studente_h
#define studentimatricolaesame_studente_h

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct elem{
    int voto;
    struct elem* next;
} esame;

typedef char string[5];

typedef struct elems{
    string matricola;
    esame* info;
    struct elems* next;
} studente;

typedef studente* studenti;

studenti inseriscistudente(studenti);

void aggiungivoto(esame*);

void stampa(studenti);

#endif

// COMPILATO

#include "studente.h"

studenti inseriscistudente(studenti l){
    studente* nuovo = malloc(sizeof(studente));
    nuovo->next = NULL;
    printf("Inserire matricola: ");
    string m;
    scanf("%s", m);
    strcpy(nuovo->matricola, m);
    
    esame* p = malloc(sizeof(esame));
    p->next = NULL;
    printf("Inserire voto: ");
    scanf("%d",&p->voto);
    nuovo->info=p;
    
    printf("Continuare? y/n\n");
    char risposta='y';
    scanf(" %c", &risposta);
    while (risposta=='y' || risposta=='Y'){
        aggiungivoto(nuovo->info);
        printf("Continuare? y/n\n");
        scanf(" %c", &risposta);
    }
    return l;
}

void aggiungivoto(esame* l){
    esame* v = malloc(sizeof(esame));
    v->next = NULL;
    printf("Inserire voto: ");
    scanf("%d",&v->voto);
    while (l->next!=NULL)
        l=l->next;
    l->next=v;
}

void stampaesami(esame* l){
    while (l!=NULL){
        printf("%d ", l->voto);
        l=l->next;
    }
}

void stampa(studenti l){
    while (l!=NULL){
        printf("Matricola: %s\n", l->matricola);
        printf("Voti dello studente: ");
        stampaesami(l->info);
        printf("\n");
        l=l->next;
    }
}

// MAIN

int main(int argc, const char * argv[])
{
    studenti scemi = malloc(sizeof(studente));
    strcpy(scemi->matricola,"AB123");
    esame* esami = malloc(sizeof(esame));
    esami->voto = 3;
    scemi->info = esami;
    stampa(scemi);
    printf("\n");
    inseriscistudente(scemi);
    printf("\n");
    stampa(scemi);
    return 0;
}