Skip to content

Commit

Permalink
Add Example Answer (#20)
Browse files Browse the repository at this point in the history
* add general answer 35-46 & fix judge

* update update

* add news
  • Loading branch information
YusukeKato authored Nov 27, 2024
1 parent 9cea7bc commit 78fe489
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 23 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ Shell one-liner playground: https://shellgei-online-judge.com/
### Install nginx
execute the following command:
```sh
# install nginx
sudo apt update && sudo apt -y upgrade
# sudo dnf update && sudo dnf upgrade

# install nginx
sudo apt -y install nginx

# install php
Expand Down
40 changes: 35 additions & 5 deletions client/html/index.en.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@


<title>シェル芸オンラインジャッジ / SHELLGEI ONLINE JUDGE</title>
<link rel="icon" href="https://shellgei-online-judge.com/favicon.jpg?version=1092">
<link rel="stylesheet" href="https://shellgei-online-judge.com/style.css?version=1092">
<link rel="icon" href="https://shellgei-online-judge.com/favicon.jpg?version=1095">
<link rel="stylesheet" href="https://shellgei-online-judge.com/style.css?version=1095">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:[email protected]&display=swap" rel="stylesheet">
Expand Down Expand Up @@ -55,11 +55,12 @@ <h1 class="heading-028" data-label="SHELLGEI ONLINE JUDGE">Shell one-liner playg
<h2>INFORMATION</h2>
<h3>LAST UPDATED</h3>
<ul>
<li>- 2024/11/24</li>
<li>- 2024/11/28</li>
</ul>

<h3>NEWS</h3>
<ul>
<li>- 2024/11/28: Added Example Answer</li>
<li>- 2024/09/06: Added Image Problems</li>
<li>- 2024/05/03: 1st Anniversary of SHELLGEI ONLINE JUDGE</li>
<li>- 2024/04/24: Added Exercise Problems</li>
Expand Down Expand Up @@ -122,6 +123,8 @@ <h3>How to play</h3>
<details>
<summary>2024</summary>
<ul>
<li>- 11/28: news追加</li>
<li>- 11/27: GENERALの回答例を追加、正誤判定を修正</li>
<li>- 11/24: concatとcowsayを削除</li>
<li>- 11/23: ドキュメントのメンテナンス</li>
<li>- 11/22: ドキュメントのメンテナンス</li>
Expand Down Expand Up @@ -206,7 +209,7 @@ <h3>GitHub</h3>
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions">GitHub - Discussions</a></li>
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/issues">GitHub - Issues</a></li>
</ul>
<h3>Others</h3>
<h3>Author</h3>
<ul>
<li>- GitHub : <a href="https://github.com/YusukeKato">YusukeKato</a></li>
<li>- Blog : <a href="https://yusukekato.jp/">yusukekato.jp</a></li>
Expand Down Expand Up @@ -318,6 +321,33 @@ <h3>Answer</h3>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print substr($1,1,1), length($1)}'</code></pre></div>
<p>34</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | factor | xargs -n1 | awk 'NR&gt;1' | xargs | awk '{for(i=1;i&lt;=NF/5;i++){print $i}}' | awk 'BEGIN{a=1}{a=a*$1}END{print a}'</code></pre></div>
<p>35</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print $1,$1}' | xargs -n1</code></pre></div>
<p>36</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{for(i=0;i&lts$1;i++){print $1}}'</code></pre></div>
<p>37</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/[^0-9]/ /g' | awk '{for(i=1;i&lt;=NF;i++){print $i}}'</code></pre></div>
<p>38</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{if($1%$2==0){print "Yes"}else{print "No"}}'</code></pre></div>
<p>39</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/\([a-z]\)/\1\n/g' | uniq -u | tr -d '\n'</code></pre></div>
<p>40</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/\([a-z]\)/\1\n/g' | sort | uniq -c | awk 'NR&gt;1{print $2,$1}'</code></pre></div>
</details>
<details>
<summary>41 - 50</summary>
<p>41</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk 'NR==1{a=$1+$2+$3;print $0}NR==2{x=a-$1-$3;print $1,x,$3}NR==3{print $0}'</code></pre></div>
<p>42</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk 'NR==1{a=$1+$2+$3+$4+$5}NR==3{x=a-$1-$2-$4-$5;print $1,$2,x,$4,$5}NR!=3{print $0}' | sed '3 s/\( [0-9] \)/ \1/g;3 s/\( [0-9]$\)/ \1/g'</code></pre></div>
<p>43</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print $1".png",$1".jpg"}'</code></pre></div>
<p>44</p>
<div class="codeClass"><pre><code class="mono-font2">find ShellGeiData/vol.68 -type f | xargs -I@ grep entrepreneurial -rl @ | awk -F'/' '{print $NF}'</code></pre></div>
<p>45</p>
<div class="codeClass"><pre><code class="mono-font2">echo | awk '{for(i=0;i&lt;6;i++){for(j=0;j&lt;6;j++){if(i&gt;=3&&j&lt;3){printf("3")}else if(i&lt;3&&j&lt;3){printf("2")}else if(i&lt;3&&j&gt;=3){printf("1")}else if(i&gt;=3&&j&gt;=3){printf("4")}};printf("\n")}}'</code></pre></div>
<p>46</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{for(i=0;i&lt;$1;i++){for(j=0;j&lt;$1;j++){if(i==j){printf("1")}else{printf("0")}}printf("\n")}}'</code></pre></div>
</details>
</details>

Expand Down Expand Up @@ -678,7 +708,7 @@ <h3>Executed Shell-gei</h3>
<script>
var is_jp = false;
</script>
<script src="https://shellgei-online-judge.com/index.js?version=1092"></script>
<script src="https://shellgei-online-judge.com/index.js?version=1095"></script>
</div> <!-- alldiv -->
<h1 class="heading-028-2" data-label="">GitHub - <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions" class="white-link">SHELLGEI ONLINE JUDGE Discussions</a><br>&copy; 2023 YusukeKato All rights reserved.</h1>
</body>
Expand Down
44 changes: 37 additions & 7 deletions client/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@


<title>シェル芸オンラインジャッジ / SHELLGEI ONLINE JUDGE</title>
<link rel="icon" href="https://shellgei-online-judge.com/favicon.jpg?version=1092">
<link rel="stylesheet" href="https://shellgei-online-judge.com/style.css?version=1092">
<link rel="icon" href="https://shellgei-online-judge.com/favicon.jpg?version=1095">
<link rel="stylesheet" href="https://shellgei-online-judge.com/style.css?version=1095">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:[email protected]&display=swap" rel="stylesheet">
Expand Down Expand Up @@ -55,11 +55,12 @@ <h1 class="heading-028" data-label="SHELLGEI ONLINE JUDGE">シェル・ワンラ
<h2>概要</h2>
<h3>最終更新日</h3>
<ul>
<li>- 2024/11/24</li>
<li>- 2024/11/28</li>
</ul>

<h3>お知らせ</h3>
<ul>
<li>- 2024/11/28: 回答例を追加</li>
<li>- 2024/09/06: 画像問題を追加</li>
<li>- 2024/05/03: シェル芸オンラインジャッジ一周年</li>
<li>- 2024/04/24: 練習問題を追加</li>
Expand All @@ -75,9 +76,9 @@ <h3>情報</h3>
<summary>このサイトとシェル芸について</summary>
<h3>シェル芸オンラインジャッジとは</h3>
<ul>
<li>- このサイトはシェル芸非公式です。</li>
<li>- シェル芸で問題を解いて遊べます。</li>
<li>- 出力結果の正誤判定も自動で行われます。</li>
<li>- このサイトはシェル芸非公式です。</li>
</ul>
<h3>シェル芸とは</h3>
<ul>
Expand All @@ -88,7 +89,7 @@ <h3>シェル芸の例</h3>
<p>Example 1: Output random String</p>
<div class="codeClass"><pre><code class="mono-font2">head -c 65536 /dev/urandom | tr -dc a-zA-Z0-9 | cut -c -16</code></pre></div>
<p>Example 2: Delete all .jpg files</p>
<div class="codeClass"><pre><code class="mono-font2">find . | grep .jpg$ | xargs -I@ rm @</code></pre></div>
<div class="codeClass"><pre><code class="mono-font2">find /tmp | grep .jpg$ | xargs -I@ rm @</code></pre></div>
<h3>Shellgei Online Judge Repository</h3>
<ul>
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge">GitHub - ShellgeiOnlineJudge</a></li>
Expand Down Expand Up @@ -122,6 +123,8 @@ <h3>遊び方</h3>
<details>
<summary>2024</summary>
<ul>
<li>- 11/28: news追加</li>
<li>- 11/27: GENERALの回答例を追加、正誤判定を修正</li>
<li>- 11/24: concatとcowsayを削除</li>
<li>- 11/23: ドキュメントのメンテナンス</li>
<li>- 11/22: ドキュメントのメンテナンス</li>
Expand Down Expand Up @@ -206,7 +209,7 @@ <h3>GitHub</h3>
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions">GitHub - Discussions</a></li>
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/issues">GitHub - Issues</a></li>
</ul>
<h3>その他</h3>
<h3>Author</h3>
<ul>
<li>- GitHub : <a href="https://github.com/YusukeKato">YusukeKato</a></li>
<li>- Blog : <a href="https://yusukekato.jp/">yusukekato.jp</a></li>
Expand Down Expand Up @@ -318,6 +321,33 @@ <h3>回答例</h3>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print substr($1,1,1), length($1)}'</code></pre></div>
<p>34</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | factor | xargs -n1 | awk 'NR&gt;1' | xargs | awk '{for(i=1;i&lt;=NF/5;i++){print $i}}' | awk 'BEGIN{a=1}{a=a*$1}END{print a}'</code></pre></div>
<p>35</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print $1,$1}' | xargs -n1</code></pre></div>
<p>36</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{for(i=0;i&lts$1;i++){print $1}}'</code></pre></div>
<p>37</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/[^0-9]/ /g' | awk '{for(i=1;i&lt;=NF;i++){print $i}}'</code></pre></div>
<p>38</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{if($1%$2==0){print "Yes"}else{print "No"}}'</code></pre></div>
<p>39</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/\([a-z]\)/\1\n/g' | uniq -u | tr -d '\n'</code></pre></div>
<p>40</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/\([a-z]\)/\1\n/g' | sort | uniq -c | awk 'NR&gt;1{print $2,$1}'</code></pre></div>
</details>
<details>
<summary>41 - 50</summary>
<p>41</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk 'NR==1{a=$1+$2+$3;print $0}NR==2{x=a-$1-$3;print $1,x,$3}NR==3{print $0}'</code></pre></div>
<p>42</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk 'NR==1{a=$1+$2+$3+$4+$5}NR==3{x=a-$1-$2-$4-$5;print $1,$2,x,$4,$5}NR!=3{print $0}' | sed '3 s/\( [0-9] \)/ \1/g;3 s/\( [0-9]$\)/ \1/g'</code></pre></div>
<p>43</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print $1".png",$1".jpg"}'</code></pre></div>
<p>44</p>
<div class="codeClass"><pre><code class="mono-font2">find ShellGeiData/vol.68 -type f | xargs -I@ grep entrepreneurial -rl @ | awk -F'/' '{print $NF}'</code></pre></div>
<p>45</p>
<div class="codeClass"><pre><code class="mono-font2">echo | awk '{for(i=0;i&lt;6;i++){for(j=0;j&lt;6;j++){if(i&gt;=3&&j&lt;3){printf("3")}else if(i&lt;3&&j&lt;3){printf("2")}else if(i&lt;3&&j&gt;=3){printf("1")}else if(i&gt;=3&&j&gt;=3){printf("4")}};printf("\n")}}'</code></pre></div>
<p>46</p>
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{for(i=0;i&lt;$1;i++){for(j=0;j&lt;$1;j++){if(i==j){printf("1")}else{printf("0")}}printf("\n")}}'</code></pre></div>
</details>
</details>

Expand Down Expand Up @@ -678,7 +708,7 @@ <h3>実行したシェル芸</h3>
<script>
var is_jp = true;
</script>
<script src="https://shellgei-online-judge.com/index.js?version=1092"></script>
<script src="https://shellgei-online-judge.com/index.js?version=1095"></script>
</div> <!-- alldiv -->
<h1 class="heading-028-2" data-label="">GitHub - <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions" class="white-link">SHELLGEI ONLINE JUDGE Discussions</a><br>&copy; 2023 YusukeKato All rights reserved.</h1>
</body>
Expand Down
44 changes: 38 additions & 6 deletions client/scripts/generate_index_html.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
update_date = "2024/11/24"
version_str = "?version=1092"
update_date = "2024/11/28"
version_str = "?version=1095"

site_title = "シェル芸オンラインジャッジ / SHELLGEI ONLINE JUDGE"
summary_url = "https://yusukekato.jp/images/summary.jpg"
Expand Down Expand Up @@ -109,6 +109,7 @@ def write_index_html(lang):
if lang == "jp":
lines.append('<h3>お知らせ</h3>\n')
lines.append('<ul>\n')
lines.append('<li>- 2024/11/28: 回答例を追加</li>\n')
lines.append('<li>- 2024/09/06: 画像問題を追加</li>\n')
lines.append('<li>- 2024/05/03: シェル芸オンラインジャッジ一周年</li>\n')
lines.append('<li>- 2024/04/24: 練習問題を追加</li>\n')
Expand All @@ -117,6 +118,7 @@ def write_index_html(lang):
elif lang == "en":
lines.append('<h3>NEWS</h3>\n')
lines.append('<ul>\n')
lines.append('<li>- 2024/11/28: Added Example Answer</li>\n')
lines.append('<li>- 2024/09/06: Added Image Problems</li>\n')
lines.append('<li>- 2024/05/03: 1st Anniversary of SHELLGEI ONLINE JUDGE</li>\n')
lines.append('<li>- 2024/04/24: Added Exercise Problems</li>\n')
Expand All @@ -136,9 +138,9 @@ def write_index_html(lang):
lines.append('<summary>このサイトとシェル芸について</summary>\n')
lines.append('<h3>シェル芸オンラインジャッジとは</h3>\n')
lines.append('<ul>\n')
lines.append('<li>- このサイトはシェル芸非公式です。</li>\n')
lines.append('<li>- シェル芸で問題を解いて遊べます。</li>\n')
lines.append('<li>- 出力結果の正誤判定も自動で行われます。</li>\n')
lines.append('<li>- このサイトはシェル芸非公式です。</li>\n')
lines.append('</ul>\n')
lines.append('<h3>シェル芸とは</h3>\n')
lines.append('<ul>\n')
Expand All @@ -149,7 +151,7 @@ def write_index_html(lang):
lines.append('<p>Example 1: Output random String</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">head -c 65536 /dev/urandom | tr -dc a-zA-Z0-9 | cut -c -16</code></pre></div>\n')
lines.append('<p>Example 2: Delete all .jpg files</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">find . | grep .jpg$ | xargs -I@ rm @</code></pre></div>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">find /tmp | grep .jpg$ | xargs -I@ rm @</code></pre></div>\n')
lines.append('<h3>Shellgei Online Judge Repository</h3>\n')
lines.append('<ul>\n')
lines.append('<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge">GitHub - ShellgeiOnlineJudge</a></li>\n')
Expand Down Expand Up @@ -236,6 +238,8 @@ def write_index_html(lang):
lines.append('<details>\n')
lines.append('<summary>2024</summary>\n')
lines.append('<ul>\n')
lines.append('<li>- 11/28: news追加</li>\n')
lines.append('<li>- 11/27: GENERALの回答例を追加、正誤判定を修正</li>\n')
lines.append('<li>- 11/24: concatとcowsayを削除</li>\n')
lines.append('<li>- 11/23: ドキュメントのメンテナンス</li>\n')
lines.append('<li>- 11/22: ドキュメントのメンテナンス</li>\n')
Expand Down Expand Up @@ -323,7 +327,7 @@ def write_index_html(lang):
lines.append('<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions">GitHub - Discussions</a></li>\n')
lines.append('<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/issues">GitHub - Issues</a></li>\n')
lines.append('</ul>\n')
lines.append('<h3>その他</h3>\n')
lines.append('<h3>Author</h3>\n')
lines.append('<ul>\n')
lines.append('<li>- GitHub : <a href="https://github.com/YusukeKato">YusukeKato</a></li>\n')
lines.append('<li>- Blog : <a href="https://yusukekato.jp/">yusukekato.jp</a></li>\n')
Expand All @@ -343,7 +347,7 @@ def write_index_html(lang):
lines.append('<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions">GitHub - Discussions</a></li>\n')
lines.append('<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/issues">GitHub - Issues</a></li>\n')
lines.append('</ul>\n')
lines.append('<h3>Others</h3>\n')
lines.append('<h3>Author</h3>\n')
lines.append('<ul>\n')
lines.append('<li>- GitHub : <a href="https://github.com/YusukeKato">YusukeKato</a></li>\n')
lines.append('<li>- Blog : <a href="https://yusukekato.jp/">yusukekato.jp</a></li>\n')
Expand Down Expand Up @@ -492,6 +496,34 @@ def write_index_html(lang):
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk \'{print substr($1,1,1), length($1)}\'</code></pre></div>\n')
lines.append('<p>34</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | factor | xargs -n1 | awk \'NR&gt;1\' | xargs | awk \'{for(i=1;i&lt;=NF/5;i++){print $i}}\' | awk \'BEGIN{a=1}{a=a*$1}END{print a}\'</code></pre></div>\n')
lines.append('<p>35</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk \'{print $1,$1}\' | xargs -n1</code></pre></div>\n')
lines.append('<p>36</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk \'{for(i=0;i&lts$1;i++){print $1}}\'</code></pre></div>\n')
lines.append('<p>37</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed \'s/[^0-9]/ /g\' | awk \'{for(i=1;i&lt;=NF;i++){print $i}}\'</code></pre></div>\n')
lines.append('<p>38</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk \'{if($1%$2==0){print \"Yes\"}else{print \"No\"}}\'</code></pre></div>\n')
lines.append('<p>39</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed \'s/\\([a-z]\\)/\\1\\n/g\' | uniq -u | tr -d \'\\n\'</code></pre></div>\n')
lines.append('<p>40</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed \'s/\\([a-z]\\)/\\1\\n/g\' | sort | uniq -c | awk \'NR&gt;1{print $2,$1}\'</code></pre></div>\n')
lines.append('</details>\n')
# 41 - 50
lines.append('<details>\n')
lines.append('<summary>41 - 50</summary>\n')
lines.append('<p>41</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk \'NR==1{a=$1+$2+$3;print $0}NR==2{x=a-$1-$3;print $1,x,$3}NR==3{print $0}\'</code></pre></div>\n')
lines.append('<p>42</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk \'NR==1{a=$1+$2+$3+$4+$5}NR==3{x=a-$1-$2-$4-$5;print $1,$2,x,$4,$5}NR!=3{print $0}\' | sed \'3 s/\\( [0-9] \\)/ \\1/g;3 s/\\( [0-9]$\\)/ \\1/g\'</code></pre></div>\n')
lines.append('<p>43</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk \'{print $1\".png\",$1\".jpg\"}\'</code></pre></div>\n')
lines.append('<p>44</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">find ShellGeiData/vol.68 -type f | xargs -I@ grep entrepreneurial -rl @ | awk -F\'/\' \'{print $NF}\'</code></pre></div>\n')
lines.append('<p>45</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">echo | awk \'{for(i=0;i&lt;6;i++){for(j=0;j&lt;6;j++){if(i&gt;=3&&j&lt;3){printf(\"3\")}else if(i&lt;3&&j&lt;3){printf(\"2\")}else if(i&lt;3&&j&gt;=3){printf(\"1\")}else if(i&gt;=3&&j&gt;=3){printf(\"4\")}};printf(\"\\n\")}}\'</code></pre></div>\n')
lines.append('<p>46</p>\n')
lines.append('<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk \'{for(i=0;i&lt;$1;i++){for(j=0;j&lt;$1;j++){if(i==j){printf(\"1\")}else{printf(\"0\")}}printf(\"\\n\")}}\'</code></pre></div>\n')
lines.append('</details>\n')
lines.append('</details>\n') # general answer
lines.append('\n')
Expand Down
Loading

0 comments on commit 78fe489

Please sign in to comment.