-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRainDrop.java
More file actions
45 lines (45 loc) · 998 Bytes
/
RainDrop.java
File metadata and controls
45 lines (45 loc) · 998 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
35
36
37
38
39
40
41
42
43
44
45
import java.util.*;
class rainDrop
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if(n%3==0 && n%5==0 && n%7==0)
{
System.out.println("PlingPlangPong");
}
else if(n%3==0 && n%5==0)
{
System.out.println("PlingPlang");
}
else if(n%3==0 && n%7==0)
{
System.out.println("PlingPong");
}
else if(n%5==0 && n%7==0)
{
System.out.println("PlangPong");
}
else if(n%7==0 && n%3==0)
{
System.out.println("PlingPlang");
}
else if(n%3==0)
{
System.out.println("Pling");
}
else if(n%5==0)
{
System.out.println("Plang");
}
else if(n%7==0)
{
System.out.println("Plong");
}
else
{
System.out.println(n);
}
}
}