当前位置:网站首页>Openjudge: upper and lower case letters are interchanged
Openjudge: upper and lower case letters are interchanged
2022-07-28 05:36:00 【Programmer system】
describe
Replace all uppercase letters in a string with lowercase letters , At the same time, replace lower case letters with upper case letters .
Input
The input line : The string to be exchanged .
Output
Output one line : String that completes the interchange ( String length is less than 80).
The sample input
If so, you already have a Google Account. You can sign in on the right.
Sample output
iF SO, YOU ALREADY HAVE A gOOGLE aCCOUNT. yOU CAN SIGN IN ON THE RIGHT.
Code
s = input()
for c in s:
if 'a' <= c <= 'z':
print(chr(ord(c) - 32 ),end="")
elif 'A' <= c <= 'Z':
print(chr(ord(c) + 32),end="")
else:
print(c,end="")边栏推荐
- BeanUtils.copyProperties无法复制不同List集合问题解决 Lists.transform函数
- openjudge:找出全部子串位置
- GET与POST区别
- 蒙特卡罗方法求解圆周率π并用turtle画点,以及完成进度条问题
- 多系统架构设计思考
- Performance test classification
- ByteBuffer. Position throws exception illegalargumentexception
- [computer level 3 information security] overview of information security assurance
- sql 查询list时两次的数据不一致,自动加上了limit
- Oracle用sql查询某张表的字段信息(字段类型、长度等)
猜你喜欢
随机推荐
C language: addition and deletion of linked list in structure
Invalid bound statement (not found): com.exam.mapper.UserMapper.findbyid
openjudge:判断字符串是否为回文
凛冬已至,程序员该怎么取暖
[singleton mode] thread safety of lazy mode
First acquaintance with C language (1)
正则表达式
FusionGAN代码学习(一)
C language: some self realization of string functions
Thesis writing function words
【idea插件神器】教你如何使用IDEA一键set实体类中所有属性
docker 部署 mysql5.7.35
regular expression
Confused, I'm going to start running in the direction of [test]
深度学习医学图像模型复现
Thinking on multi system architecture design
Problems encountered when the registry service Eureka switches to nocas
Response < t > class
yandex robots txt
MySQL basic query









