{ "question_id": 7436615, "question_title": "分支结构问题 ", "question_content": "

实现从键盘输入一个字符时,如果该字符为小写字母,则转换为大写字母输出;如果该字符为大写字母,则转换为小写字母输出;如果为其他字符,则原样输出。

", "difficulty": "简单", "answer_id": 53408453, "answer_content": "
\n#include<stdio.h>\nint main()\n{\nchar x,y;\nprintf("请输入一个字符:");\nscanf("%c",&x);\nif(x>='A'&&x<='Z')\n{\ny=x+32;\nprintf("此字母是一个大写字母,转换后的小写字母是:%c",y);\n}\nelse if(x>='a'&&x<='z')\n{\ny=x-32;\nprintf("此字母是一个小写字母,转换后的大写字母是%c",y);\n}\nelse\n{\nprintf("%c",x);\n}\nreturn 0;\n}\n
\n\n

记得点个采纳,谢谢 

\n", "tag_name": "c语言", "cpp": "#include\nint main()\n{\n\tchar x,y;\n\tprintf(\"请输入一个字符:\");\n\tscanf(\"%c\",&x);\n\tif(x>='A'&&x<='Z')\n\t{\n\t\ty=x+32;\n\t\tprintf(\"此字母是一个大写字母,转换后的小写字母是:%c\",y);\n\t}\n\telse if(x>='a'&&x<='z')\n\t{\n\t\ty=x-32;\n\t\tprintf(\"此字母是一个小写字母,转换后的大写字母是%c\",y);\n\t}\n\telse\n\t{\n\t\tprintf(\"%c\",x);\n\t}\n\treturn 0;\n}", "topic_link": "https://bbs.csdn.net/topics/600469945", "status": 1, "keywords": "算法高阶,递归结构,高级数据结构,van Emde Boas树,原型van Emde Boas结构", "license": "csdn.net", "notebook": { "cpp": "https://codechina.csdn.net/csdn/csdn-daily-code/-/jupyter/master/data/notebook/answer/ipynb/cpp/41.ipynb?type=file" }, "notebook_enable": 1, "author": "qq_41219571" }