-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathASCII-Cat.java
More file actions
30 lines (28 loc) · 882 Bytes
/
ASCII-Cat.java
File metadata and controls
30 lines (28 loc) · 882 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
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
/*
* The only trick was to make your life easier not using ASCII values but chars
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
String catFamily = "";
for(int i = 0; i < r; i++){
String firstLine = "";
String secLine = "";
String thirdLine = "";
for(int j = 0; j < c; j++){
firstLine += " /\\_/\\ ";
secLine += " ( o.o )";
thirdLine += " > ^ < ";
}
catFamily += firstLine + "\n" + secLine + "\n" + thirdLine + "\n";
}
System.out.print(catFamily);
}
}