8.17 ZOOM c++ 试题

20道单选 10道不定项 编程题1 1道 编程题2 1道

早知道编程这么简单 就先做编程了

第一题 大小写转换

#include <iostream>
using namespace std;
int main(){
    string str = "";
    getline(cin, str);
    for(auto &it:str)
        if((it >= 'a' && it <= 'z') || (it >= 'A' && it <= 'Z'))
            it ^= ' ';
    cout << str;
    return 0;
}

第二题 格式转换

#include <iostream>
using namespace std;
int main(){
    string str = "", res = "";
    cin >> str;
    for(int i=0; i<str.size(); i+=2)
        res = res + string(str[i+1]-'0', str[i]);
    cout << res << endl;
    return 0;
}
#ZOOM#
全部评论
有道理啊,以后先做编程题
点赞 回复 分享
发布于 2019-08-17 15:31
ac第一道,第二道没时间写啦😭,请问能进面试吗?
点赞 回复 分享
发布于 2022-03-21 20:24
我第一题一直不能ac啊。。。要炸了。你也是utf-8格式的字符串吗?
点赞 回复 分享
发布于 2019-08-17 15:43

相关推荐

06-08 22:25
门头沟学院 Java
从零开始的转码生活:这hr不会打开手机不分青红皂白给所有人群发这句话,过一会再给所有人再发一遍,这肯定会有重复的,不管,再过一会再发一遍
点赞 评论 收藏
分享
评论
4
12
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务