第41152题 判断题
为实现如下效果,即N行N列字符。当输入是奇数时,中间列为*,其他是-;当输入是偶数时,则中间两列是*,其他是-。字符阵列后的代码能实现其效果。( )
5
--*--
--*--
--*--
--*--
--*--
N = int(input())

for i in range(N):
    for j in range(N):
        if j == N // 2 or j == (N-1) // 2:
            print("*",end="")
        else:
            print("-",end="")
    print()
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析