ф
package com.javarush.task.task18.task1820;
/*
Округление чисел
*/
import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
import java.lang.Math;
public class Solution {
public static void main(String[] args) throws IOException{
Scanner num = new Scanner(System.in);
String name1 = num.nextLine();
String name2 = num.nextLine();
FileInputStream fileInputStream1 = new FileInputStream(name1);
FileOutputStream fileOutputStream = new FileOutputStream(name2);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream1));
ArrayList<String[]> arrayList = new ArrayList<>();
while(fileInputStream1.available() > 0){
String str = bufferedReader.readLine();
arrayList.add(str.split(" "));
}
for (int i = 0; i < arrayList.size(); i++) {
for (int j = 0; j < arrayList.get(i).length; j++) {
fileOutputStream.write((int)Math.round(Double.parseDouble(arrayList.get(i)[j])));
fileOutputStream.write(' ');
}
}
fileInputStream1.close();
fileOutputStream.close();
}
}