解题思路:
第二个ord函数,直接在内部取膜就好,就可以直接取到第一个了
注意事项:
111
参考代码:
s = input() s1 = '' for i in range(len(s)): s1 += chr(ord(s[i])+ord(s[(i+1)%len(s)])) print(s1)
0.0分
1 人评分
c=str(input()) ls=str() count=0 while (count)<len(c): a=chr(ord(c[count])+ord(c[(count+1)%len(c)])) ls+=a count+=1 print("".join(ls)) 是这样,刚才复制错了,这样为什么会错
c=str(input()) ls=str() count=0 while (count)<len(c): a=chr(ord(c[count])+ord(c[(count+1)%len(c)])) ls+=a print(ls) 请问这样写为什么会错
数列排序 (C语言代码)浏览:836 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:277 |
最小公倍数 (C语言代码)浏览:863 |
【蟠桃记】 (C语言代码)浏览:664 |
WU-小九九 (C++代码)浏览:1684 |
剪刀石头布 (C语言代码)浏览:753 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:690 |
C二级辅导-阶乘数列 (C语言代码)浏览:522 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:471 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:615 |