{
  "question_id": 7436615,
  "question_title": "分支结构问题 ",
  "question_content": "<p>实现从键盘输入一个字符时&#xff0c;如果该字符为小写字母&#xff0c;则转换为大写字母输出&#xff1b;如果该字符为大写字母&#xff0c;则转换为小写字母输出&#xff1b;如果为其他字符&#xff0c;则原样输出。</p>",
  "difficulty": "简单",
  "answer_id": 53408453,
  "answer_content": "<pre>\n<code>#include&lt;stdio.h&gt;\nint main()\n{\nchar x,y;\nprintf(&#34;请输入一个字符&#xff1a;&#34;);\nscanf(&#34;%c&#34;,&amp;x);\nif(x&gt;&#61;&#39;A&#39;&amp;&amp;x&lt;&#61;&#39;Z&#39;)\n{\ny&#61;x&#43;32;\nprintf(&#34;此字母是一个大写字母,转换后的小写字母是&#xff1a;%c&#34;,y);\n}\nelse if(x&gt;&#61;&#39;a&#39;&amp;&amp;x&lt;&#61;&#39;z&#39;)\n{\ny&#61;x-32;\nprintf(&#34;此字母是一个小写字母,转换后的大写字母是%c&#34;,y);\n}\nelse\n{\nprintf(&#34;%c&#34;,x);\n}\nreturn 0;\n}\n</code></pre>\n\n<p>记得点个采纳&#xff0c;谢谢 </p>\n",
  "tag_name": "c语言",
  "cpp": "#include<stdio.h>\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"
}