zoukankan      html  css  js  c++  java
  • P5733 【深基6.例1】自动修正

    题目传送门

    #include <bits/stdc++.h>
    
    using namespace std;
    
    int main() {
        string s;
        cin >> s;
        //方式1
        for (int i = 0; i < s.size(); i++)
            printf("%c", toupper(s[i]));
        printf("\n");
        //方式2
        for (int i = 0; i < s.size(); i++)
            printf("%c", s[i] >= 'a' && s[i] <= 'z' ? s[i] - 32 : s[i]);
        printf("\n");
        //方式3
        transform(s.begin(), s.end(), s.begin(), ::toupper);
        printf("%s\n", s.c_str());
        return 0;
    }
    
  • 相关阅读:
    第8周课下作业1(补)
    第八章课下测试
    POJ
    POJ
    HDU
    UVa
    UVa
    CodeForces
    ZOJ
    LightOJ
  • 原文地址:https://www.cnblogs.com/littlehb/p/15570753.html
Copyright © 2011-2022 走看看