求助为何需要二次赋值
查看原帖
求助为何需要二次赋值
560814
anaoai楼主2021/8/27 15:18

C++尝试使用toupper函数但是

#include <bits/stdc++.h>
int main(){
    char x;
    std::cin>>x;
    toupper(x);
    std::cout<<x;
}

这种情况无法转换大写但是

#include <bits/stdc++.h>
int main(){
    char x;
    std::cin>>x;
    char y=toupper(x);
    std::cout<<y;
}

用另外的变量二次赋值就可以了,感谢

2021/8/27 15:18
加载中...