-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDay8.java
More file actions
35 lines (33 loc) · 829 Bytes
/
Day8.java
File metadata and controls
35 lines (33 loc) · 829 Bytes
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
27
28
29
30
31
32
33
34
//Complete this code or write your own from scratch
import java.util.*;
import java.io.*;
class Day8{
public static void main(String []argh){
Scanner in = new Scanner(System.in);
int n = in.nextInt();
String N[]=new String[100000];
int P[]=new int[100000];
for(int i = 0; i < n; i++)
{
String name = in.next();
int phone = in.nextInt();
N[i]=name;
P[i]=phone;
}
int i=0;
while(in.hasNext())
{
String s = in.next();
if(s.equals(N[i]))
{
System.out.println(N[i]+"="+P[i]);
}
else
{
System.out.println("Not found");
}
i++;
}
in.close();
}
}