-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathQuine.java
More file actions
32 lines (32 loc) · 901 Bytes
/
Quine.java
File metadata and controls
32 lines (32 loc) · 901 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
public class Quine {
public static void main(String[] args) {
char quote = 34;
String[] code = {
"public class Quine {",
" public static void main(String[] args) {",
" char quote = 34;",
" String[] code = {",
" };",
" for(int i=0; i<4; i++){",
" System.out.println(code[i]);",
" }",
" for(int i=0; i<code.length; i++){",
" System.out.println(quote + code[i] + quote + ',');",
" }",
" for(int i=4; i<code.length; i++){",
" System.out.println(code[i]);",
" }",
" }",
"}",
};
for(int i=0; i<4; i++){
System.out.println(code[i]);
}
for(int i=0; i<code.length; i++){
System.out.println(quote + code[i] + quote + ',');
}
for(int i=4; i<code.length; i++){
System.out.println(code[i]);
}
}
}