Answer:
Explanation:
CODE:
import java.io.*;
class Test
{
public static void main(String[] args) {
File file = new File("input.txt");
try{
BufferedReader b = new BufferedReader(new FileReader(file));
String line;
while ((line = b.readLine()) != null)
{
for(int i=0;i<line.length();i++)
{
char c=line.charAt(i);
if((c>='A' && c<='Z') || (c>='a' && c<='z') || (c>='0' && c<='9')) //check if char is digit or alphabet
System.out.print(c);
else
System.out.println("\n"+c);
}
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}