public class Takuzu {
public static void main (String [] args){
int i,j;
int[][] a = new int[4][4];
try{
FileOutputStream fos = new FileOutputStream(new File("D:\\input.txt"));
//FileWriter writer = new FileWriter(new File("D:\\input.txt"));
DataOutputStream dos = new DataOutputStream(fos);
Scanner sc = new Scanner(System.in);
for( i= 0;i<4;i++){
for(j= 0;j<4;j++){
a[i][j] = sc.nextInt();
dos.write(a[i][j]);
}
}
fos.close();
dos.close();
}catch (Exception e){};
}
chúc mừng năm mới mọi người, các anh chị cho em hỏi là đoạn code chạy ok nhưng mở file thì nó lại bị mã hóa là sao ạ. Em muốn ghi mảng 2 chiều vào file ạ. E cảm ơn