arrow_forward همه ارسال‌ها

جزئیات ارسال کد#885

code_blocks
مسئله مربوطه: رسم شکل - مارپیچ (#13) arrow_outward
verified
وضعیت داوری نهایی: پاسخ نادرست تست 5
terminal
زبان برنامه‌نویسی: Kotlin
schedule
ارسال‌کننده و زمان:
melisa azadi (۱۰ ماه پیش)
descriptionsolution.kt ۳۹ خط • ۷۳۶ بایت
1
2fun main(){
3 var (n,m) = readLine()!!.split(" ").map { it.toInt() }
4 var b = true
5 while (n > 0){
6 if(n%2==0){
7 var x = 0
8 while (x<m){
9 print("#")
10 x++
11 }
12 }
13 else{
14 if(b){
15 var j = 1
16 while (j<m){
17 print("*")
18 j++
19 }
20 print("#")
21 b = false
22 }
23 else{
24 print("#")
25 var j = 1
26 while (j<m){
27 print("*")
28 j++
29 }
30 b = true
31
32 }
33
34 }
35 println()
36 n--
37 }
38
39}
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8