大小写转换

来源:互联网 发布:知乎的神回复 编辑:程序博客网 时间:2024/05/15 05:29
// 大小写转换.cpp : 定义控制台应用程序的入口点。////#include "stdafx.h"#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>#include<stdlib.h>using namespace std;const int maxn = 1005;char str[ maxn ];//string str;//int _tmain(int argc, _TCHAR* argv[])int main(){while( cin >> str ){for( int i = 0; i < strlen( str ); ++i )str[ i ] = toupper( str[ i ] );cout << str << endl;}return 0;}

原创粉丝点击