#include #include #include using namespace std; void leggi(int P[],int dimP, int &lettiP, int T[],int dimT, int &lettiT, int &dim0, int &dim1, int &dim2) { try { bool sentinella; ifstream IN("input"); if(!IN) throw(1); sentinella=false; int x,y; IN>>x; for(int i=0; i>x; } else if(i==(dimP-1)) P[i]=x; else { IN>>y; if(y!="-1") { P[i]=x; P[i+1]=y; i++; } else sentinella=true; } lettiP=i; } IN>>dim0; IN>>dim1; IN>>dim2; if((dim0*dim1*dim2)>=dimT) throw(2); sentinella=false; int k,z; IN>>z; for(int i=0; i<(dim0*dim1*dim2) && !sentinella; i++) { if(z!="-1") { T[i]=z; IN>>z; } else { IN>>k; if(k!="-1") { T[i]=z; T[i+1]=k; i++; } else sentinella=true; } lettiT=i; } } catch(int error) { if(error==1) cout<<"problemi con il file di input"<