Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Solution {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader (new InputStreamReader (System.in));
- String file1 = reader.readLine ();
- String file2 = reader.readLine ();
- reader.close ();
- FileInputStream fileInputStream = new FileInputStream (file1);
- FileOutputStream fileOutputStream = new FileOutputStream (file2);
- ArrayList<String> list = new ArrayList<String> ();
- byte[] buffer1 = new byte[fileInputStream.available ()];
- while (fileInputStream.available () > 0) {
- fileInputStream.read (buffer1);
- }
- String temp = new String (buffer1);
- for (String z : temp.split(" ")) {
- float x = Float.parseFloat(z);
- list.add(Math.round(x) + " ");
- }
- for (String h : list) {
- fileOutputStream.write(h.getBytes());
- }
- fileInputStream.close ();
- fileOutputStream.close ();
- }
- }
- byte[] buffer1 = ...
- String temp = new String (buffer1);
Add Comment
Please, Sign In to add comment