如题所述
å¨ASCç ä¸ï¼å¤§å°åå符åå«è¿ç»åå¨ãæ以ï¼ç¸åå符ç大å°åå·®å¼æ¯ç¸åçï¼è¿ä¸ªå·®å¼æ¯åè¿å¶ç32ã
å¨ä¸è®°å¾è¿ä¸ªå·®å¼çæ åµä¸ï¼å¯ä»¥ç¨'a'-'A'æ¥è¡¨ç¤ºã
äºæ¯ï¼å¤§å转为å°åï¼å¯ä»¥åä½
c = c-('A'-'a');
æ
c = c+32;
å°å转为大åï¼å¯ä»¥åä½
c = c-('a'-'A');
æ
c=c-32;
å¨ä¸è®°å¾è¿ä¸ªå·®å¼çæ åµä¸ï¼å¯ä»¥ç¨'a'-'A'æ¥è¡¨ç¤ºã
äºæ¯ï¼å¤§å转为å°åï¼å¯ä»¥åä½
c = c-('A'-'a');
æ
c = c+32;
å°å转为大åï¼å¯ä»¥åä½
c = c-('a'-'A');
æ
c=c-32;
温馨提示:答案为网友推荐,仅供参考