-
Notifications
You must be signed in to change notification settings - Fork 1
/
LargeInput.java
37 lines (33 loc) · 1.06 KB
/
LargeInput.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
27
28
29
30
31
32
33
34
35
36
37
import java.util.StringTokenizer;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class LargeInput{
public static void main(String args[]){
int a,b,count=0;
BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in));
try{
String str=buffer.readLine();
String []split_=str.split(" ");
a=Integer.parseInt(split_[0]);
b=Integer.parseInt(split_[1]);
// StringTokenizer st=new StringTokenizer(buffer,"\n");
while( (str=buffer.readLine())!=null){
if(Integer.parseInt(str)%b==0)
count++;
}
//System.out.println(st.nextElement());
System.out.println("\n"+count);
}catch (IOException e){
e.printStackTrace();}
finally {
try{
if(buffer!=null)buffer.close();
}catch (IOException ex){
ex.printStackTrace();
}
}
System.exit(0);
}
}