#!/usr/bin/python
# -*- coding:utf-8 -*-

# @filename: tmp2
# @author:vickey
# @date: 2017/10/23 17:05


def circle_nested(total, inside):
    for i in range(1, total + 1):

        if i > inside:                                    # i = 11
            j = i - inside * ((i - 1) / inside)
            print(i, j)
        else:
            print(i, i)

circle_nested(13, 3)

效果:

(1, 1)
(2, 2)
(3, 3)
(4, 1)
(5, 2)
(6, 3)
(7, 1)
(8, 2)
(9, 3)
(10, 1)
(11, 2)
(12, 3)
(13, 1)

相关文章:

  • 2021-07-04
  • 2021-09-16
  • 2021-10-07
  • 2021-12-13
  • 2022-01-24
  • 2021-09-15
  • 2022-12-23
猜你喜欢
  • 2021-10-16
  • 2021-05-17
  • 2022-12-23
  • 2021-09-29
  • 2021-06-14
  • 2021-09-26
  • 2021-10-15
相关资源
相似解决方案