zoukankan      html  css  js  c++  java
  • 字符串大小写转换

     1 #include<stdafx.h>
     2 #include<iostream>
     3 #include<string>
     4 #include <algorithm> 
     5 
     6 using namespace std;
     7 
     8 int main(void)
     9 {
    10     //string str;
    11     char ch;
    12     int len = 0, count = 0;
    13     string str = "abcdefghijklnmopqrstuvwxyz123";
    14     transform(str.begin(), str.end(), str.begin(), toupper);
    15     cout << str << endl;
    16     //while (getline(cin, str) && cin >> ch)
    17     //{
    18     //    len = str.length();
    19     //    for (int i = 0; i < len; i++)
    20     //    {
    21     //        if (str[i] >= 'a'&&str[i] <= 'z')
    22     //        {
    23     //            str[i] += ('A' - 'a');
    24     //        }
    25     //    }
    26     //    if (ch >= 'a' && ch <= 'z')
    27     //    {
    28     //        ch += ('A' - 'a');
    29     //    }
    30     //    for (int i = 0; i < len; i++)
    31     //    {
    32     //        if (str[i] == ch)
    33     //        {
    34     //            count++;
    35     //        }
    36     //    }
    37     //    cout << count << endl;
    38     //}
    39 
    40     
    41     return 0;
    42 }
  • 相关阅读:
    第九周作业
    第八周
    第七周
    Jmeter连接到Mysql
    数据库常用链接URL写法
    功能测试方法
    常建输入框的测试
    系统业务流程测试(转)
    Linux
    搭建Git服务器
  • 原文地址:https://www.cnblogs.com/hhboboy/p/5522439.html
Copyright © 2011-2022 走看看