Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 3
- Ruby
- Diamond
- Sapphire
- import java.util.Scanner;
- public class GemStones {
- private int numOfStones;
- private String[] gemArray;
- public void solve() throws Exception{
- Scanner in = new Scanner(System.in);
- //Reading the integer
- numOfStones = Integer.parseInt(in.nextLine());
- //in.nextLine();
- System.out.println(numOfStones);
- //reading the strings
- for(int i=0;i<numOfStones;i++){
- gemArray[i] = in.nextLine();
- System.out.println(gemArray[i]);
- }
- for(int i=0;i<numOfStones;i++){
- System.out.println(gemArray[i]);
- }
- in.close();
- }
- public static void main(String[] args) throws Exception {
- GemStones check = new GemStones();
- check.solve();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement