The test files results seems all right, but can't pass the verification.
So confused for this task. Please give me some help. Appreciate it.
package com.codegym.task.task18.task1820;
import java.io.*;
//import java.lang.String;
/*
Rounding numbers
*/
public class Solution {
public static void main(String[] args) throws Exception{
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
String fn1=reader.readLine();
String fn2=reader.readLine();
File f1=new File(fn1);
File f2=new File(fn2);
FileInputStream f1_i=new FileInputStream(f1);
FileOutputStream f2_o=new FileOutputStream(f2);
byte[] readb=new byte[f1_i.available()];
f1_i.read(readb);
f1_i.close();
String reads=new String(readb,"UTF-8");
String[] readsp=reads.split(" ");
int[] result=new int[readsp.length];
for(int i=0;i<readsp.length;i++){
float n=Float.parseFloat(readsp[i]);
int temp=Math.round(n);
result[i]=temp;
}
int tew=0;
for(int j=0;j<result.length;j++){
if(result[j]<0){
f2_o.write('-');
tew=Math.abs(result[j]);
}else{
tew=result[j];
}
f2_o.write('0'+tew);
if(j<result.length-1){
f2_o.write(' ');
}
}
f2_o.close();
}
}