import java.util.*;
import java.io.*;
public class esame{
double[][][] misure = new double[19][19][365];
//Scanner s = new Scanner();
final String File_Ingresso= "dati.txt";
public void leggiFile(String dati) throws IOException{
Scanner s = new Scanner(new FileReader(File_Ingresso));
while(s.hasNextLine()){
int x = Integer.parseInt(s.nextLine());
int y = Integer.parseInt(s.nextLine());
int k = Integer.parseInt(s.nextLine());
misure[x][y][k] = Double.parseDouble(s.nextLine());
}
}
public void mediaAnno(){
double[][] medie = new double[19][19];
for(int i = 0;i<19;i++) {
for(int j = 0;j<19;j++) {
double somma = 0;
for(int k=0;k<365;k++){
somma = somma + misure[i][j][k];
}
medie[i][j] = somma/365;
if(medie[i][j]>0) {
System.out.println("La media in posizione:" + i + "," + j + "e' " + medie[i][j]);
}
}
}
}
public static void main(String[] argv)throws IOException {
esame esm = new esame();
esm.leggiFile(" File_Ingresso");
esm.mediaAnno();
}
}
mi da sempre sto errore :
mi dice che non trova il file specificato ma nn capisco proprio il motivo poichè lavoro sulla stessa cartella..