9 条题解

  • 3
    @ 2023-9-29 13:54:55

    Python的哦~

    x=int(input())
    a=x//100
    b=x%100//10
    c=x%10
    print(a,b,c)
    
    • 2
      @ 2023-4-11 11:54:48

      一个可以逃课的小玩意 什么字符串

      #include<bits/stdc++.h>
      using namespace std;
      string a;
      int main()
      {
      	cin>>a;
      	for(int i=0;i<a.length();i++)
      		cout<<a[i]<<' ';
      }
      
      • 1
        @ 2024-5-9 14:59:38

        大家都知道用字符串偷懒输出,那我给点更偷懒的吧:)

        list()函数将可迭代对象每一个取出创建列表,这里直接取出字符串的每一个字符,比如:

        >>> list("345")
        ['3', '4', '5']
        >>> list("ac5")
        ['a', 'c', '5']
        

        *序列解包,直接输出

        Python

        print(*list(input()))
        
        • 1
          @ 2023-10-14 22:06:43

          Python

          n=str(input())
          print(n[0],n[1],n[2])
          

          偷个懒😄

          • 1
            @ 2022-7-8 14:38:46

            另一种解法

            using namespace std;
            int main()
            {
            	int a,b,c,d,e,f;
            	scanf("%1d%1d%1d",&a,&b,&c);
            	printf("%d %d %d",a,b,c);
            	return 0;
            	
            }
            
            • 0
              @ 2023-10-13 21:26:22
              from tkinter import *
              import tkinter.messagebox
              
              color_number = 1  # 每次运行都是黑棋先走
              size = 16
              stop = 0
              
              chess = [[0 for i in range(size + 1)] for i in range(size + 1)]
              def paint(event):
                  # 让棋子下在棋盘点上
                  global color_number
              
                  if event.x % 30 > 15:
                      event.x = event.x // 30 + 1
                  else:
                      event.x = event.x // 30
                  if event.y % 30 > 15:
                      event.y = event.y // 30 + 1
                  else:
                      event.y = event.y // 30
                  # 边缘检测
                  if event.x > size:
                      event.x = size
                  if event.y > size:
                      event.y = size
                  if event.x < 1:
                      event.x = 1
                  if event.y < 1:
                      event.y = 1
                  # 确定下棋坐标
                  x1, y1 = (event.x * 30 - 15), (event.y * 30 - 15)
                  x2, y2 = (event.x * 30 + 15), (event.y * 30 + 15)
                  if stop == 0:
                      if chess[event.y][event.x] == 0:
                          text1.delete("1.0", END)  # 清空文本框
                          if color_number == 1:
                              canvas.create_oval(x1, y1, x2, y2, fill="black", tags="oval")
                              chess[event.y][event.x] = 1
                              color_number = 0
                          elif color_number == 0:
                              canvas.create_oval(x1, y1, x2, y2, fill="white", tags="oval")
                              chess[event.y][event.x] = 2
                              color_number = 1
                          printtable()  # 输出二维数组
                          gameover(event.y, event.x)
              def wininfo():  # 提示窗口
                  global stop
                  tkinter.messagebox.showinfo("", "Game over")
                  stop = 1
              def gameover(xx, yy):
                  count = 0
                  for i in range(xx + 1, 17):  # 向右搜索
                      if chess[i][yy] == chess[xx][yy]:
                          count += 1
                      else:
                          break
                  for i in range(xx, 0, -1):  # 向左搜索
                      if chess[i][yy] == chess[xx][yy]:
                          count += 1
                      else:
                          break
                  if count == 5:
                      wininfo()
                  count = 0
              
                  for i in range(yy + 1, 17):  # 向下搜索
                      if chess[xx][i] == chess[xx][yy]:
                          count += 1
                      else:
                          break
                  for i in range(yy, 0, -1):  # 向上搜索
                      if chess[xx][i] == chess[xx][yy]:
                          count += 1
                      else:
                          break
                  if count == 5:
                      wininfo()
                  count = 0
              
                  for i, j in zip(range(xx + 1, 17), range(yy + 1, 17)):  # 向右下搜索
                      if chess[i][j] == chess[xx][yy]:
                          count += 1
                      else:
                          break
                  for i, j in zip(range(xx, 0, -1), range(yy, 0, -1)):  # 向左上搜索
                      if chess[i][j] == chess[xx][yy]:
                          count += 1
                      else:
                          break
                  if count == 5:
                      wininfo()
                  count = 0
              
                  for i, j in zip(range(xx - 1, 0, -1), range(yy + 1, 17)):  # 向左下搜索
                      if chess[i][j] == chess[xx][yy]:
                          count += 1
                      else:
                          break
                  for i, j in zip(range(xx, 17), range(yy, 0, -1)):  # 向右上搜索
                      if chess[i][j] == chess[xx][yy]:
                          count += 1
                      else:
                          break
                  if count == 5:
                      wininfo()
                  count = 0
              def reset():
                  global stop
                  canvas.delete('oval')
                  for i in range(size + 1):
                      for j in range(size + 1):
                          chess[i][j] = 0
                  text1.delete("1.0", END)  # 清空文本框
                  printtable()  # 输出二维数组
                  stop=0
              top = Tk()
              top.title("五子棋")
              top.geometry("1000x525")
              canvas = Canvas(top, width=500, height=500)
              canvas.pack(expand=YES, fill=BOTH)
              canvas.bind("<Button-1>", paint)  # 每次点击鼠标左键(事件),触发paint函数
              for num in range(1, 17):
                  canvas.create_line(num * 30, 30,
                                     num * 30, 480,
                                     width=2)
              for num in range(1, 17):
                  canvas.create_line(30, num * 30,
                                     480, num * 30,
                                     width=2)
              text1 = Text(top, width=51, height=18)
              text1.place(x=520, y=60, anchor='nw')
              # 退出按钮
              quit1 = Button(top, text="退出", command=top.quit, width=10, height=2)
              quit1.place(x=620, y=400, anchor='nw')
              
              # 打印五子棋落子状态
              def printtable():
                  for i in range(size + 1):
                      text1.insert(INSERT, str(chess[i]) + "\n")
              
              
              printtable()
              # 二维数组标签
              label1 = Label(top, text='chess数组内容:')
              label1.place(x=520, y=30, anchor='nw')
              # 退出按钮
              restart = Button(top, text="重置", command=reset, width=10, height=2)
              restart.place(x=520, y=400, anchor='nw')
              
              
              top.mainloop()
              
              
              • 0
                @ 2023-8-14 16:20:21

                PYTHON😕 ``` a=int(input())

                g=a%10

                b=a//100

                s=a//10%10

                l=[b,s,g]

                for i in l:

                print(i,end=" ") #搞不懂,只能用end输出了😕

                
                
                • 0
                  @ 2023-8-12 19:51:38

                  #include<bits/stdc++.h> using namespace std; int a,b,c,d;

                  signed main() { cin>>d; a=d/100; b=(d%100)/10; c=d-100a-10b; cout<<a<<" "<<b<<" "<<c; return 0; }

                  • 0
                    @ 2023-7-16 20:04:00
                    #include <iostream> 
                    using namespace std;
                    
                    int main() 
                    { 
                        int a,b,c,d; 
                        cin>>a; b=a/100; 
                        c=a/10-10*b; 
                        d=a%10; 
                        cout<<b<<" "<<c<<" "<<d; 
                        return 0;
                    }
                    
                    • 1

                    【苏州NOI】d010: 分离自然数

                    信息

                    ID
                    17
                    时间
                    1000ms
                    内存
                    128MiB
                    难度
                    3
                    标签
                    递交数
                    1572
                    已通过
                    905
                    上传者