Skip to content

Commit b98f2a3

Browse files
authored
Create SwapNumbers.java
1 parent 45efdea commit b98f2a3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Easy-Level/SwapNumbers.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.io.*;
2+
import java.util.Arrays;
3+
public class Main {
4+
public static void main (String[] args) throws IOException {
5+
File file = new File(args[0]);
6+
BufferedReader buffer = new BufferedReader(new FileReader(file));
7+
String line;
8+
while ((line = buffer.readLine()) != null) {
9+
String[] a = line.split(" ");
10+
11+
for (int j = 0; j < a.length; j++) {
12+
System.out.print(a[j].charAt(a[j].length()-1) + a[j].substring(1, a[j].length()-1) + a[j].charAt(0) + " ");
13+
}
14+
System.out.println();
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)