forked from Assasincoderzz/Java-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp4.java
26 lines (26 loc) · 755 Bytes
/
p4.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.Scanner;
import java.io.BufferedReader;
import java.io.*;
public class p4
{
public static void main(String[] args) throws Exception
{
String n =new String();
Scanner sc=new Scanner(System.in);
n=sc.nextLine();
FileWriter writer = new FileWriter("input.txt");
writer.write(n);
n=sc.nextLine();
writer.write("\n");
writer.write(n);
writer.close();
String line;
FileReader file = new FileReader("input.txt");
BufferedReader br = new BufferedReader(file);
while((line = br.readLine()) != null)
{
System.out.println(line);
}
br.close();
}
}