解题思路:
注意事项:
参考代码:
try: n = int(input()) number = list(map(int, input().split())) m = int(input()) new_number = [None] * len(number) for i in number: index = number.index(i) tem = number[index] if len(number) - index > m: new_number[index + m] = tem else: index_distance = m - (len(number) - i) new_number[0 + index_distance - 1] = tem for j in new_number: print(j, end=" ") except Exception as e: print(e)
0.0分
1 人评分
C语言程序设计教程(第三版)课后习题8.9 (C++代码)(其实不需要开数组,一个一个字符读入并判断就好了)浏览:939 |
C语言训练-求素数问题 (C语言代码)浏览:989 |
大神老白 (C语言代码)浏览:768 |
钟神赛车 (C语言代码)浏览:911 |
C语言程序设计教程(第三版)课后习题11.5 (C语言代码)浏览:1019 |
C二级辅导-公约公倍 (C语言代码)浏览:1549 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:685 |
【回文数(二)】 (C语言代码)浏览:800 |
Pascal三角 (C语言代码)浏览:1252 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1327 |