c++ primer plus 习题6.1 (cctype,cin.get)

来源:互联网 发布:淘宝账号转让平台 编辑:程序博客网 时间:2024/05/16 05:19
#include<iostream>#include<cctype>using namespace std;int main() {char ch,change;cout<<"please input:";cin.get(ch);while(ch != '@'){if(!isdigit(ch)){if(isupper(ch)){change=ch+32;cout<<change;}if(islower(ch)){change=ch-32;cout<<change;}if((!isupper(ch))&&(!islower(ch)))cout<<ch;}cin.get(ch);}return 0;}

0 0
原创粉丝点击