Created
September 22, 2017 14:10
-
-
Save kmurudi/a5fe30c01a1495356c8350a4b8a42b8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.*; | |
| import java.util.*; | |
| import java.text.*; | |
| import java.math.*; | |
| import java.util.regex.*; | |
| public class Solution { | |
| public static void main(String[] args) { | |
| /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ | |
| ArrayList list1 = new ArrayList(); | |
| Scanner sc = new Scanner(System.in); | |
| int n = sc.nextInt(); | |
| for (int i = 1;i<=n;i++){ | |
| list1.add(sc.nextLine()); | |
| } | |
| Iterator it = list1.iterator( ); | |
| while ( it.hasNext( ) ) { | |
| System.out.println( it.next( ) ); | |
| } | |
| int q = sc.nextInt(); | |
| //String[] ary = list1.get(0).split(""); | |
| ArrayList list2 = new ArrayList(); | |
| for (int i = 1;i<=q;i++){ | |
| list2.add(sc.nextLine()); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment