c++

4396y 发表于 1年前 · 关联问题 字符转换

include "pch.h"

include

using namespace std;

int main() {

char ch; while (cin>>ch) { if (ch >= 'A'&&ch <= 'Z') { ch = ch + 32; printf("%c\n", ch); } else if (ch >= 'a'&&ch <= 'z') { ch = ch - 32; printf("%c\n", ch); } else { printf("%d\n", int(ch)); }

}

}