[YTU]_2803( 字符串中小写改大写)
生活随笔
收集整理的這篇文章主要介紹了
[YTU]_2803( 字符串中小写改大写)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Description
編寫程序,輸入字符串,將字符串中所有小寫字母改為大寫字母后輸出該字符串。
Input
Output
Sample Input
abc123BNUSample Output
ABC123BNU#include <iostream> #include <cstring> #include <string> using namespace std; int main() {char str[101];int i;gets(str);for(i=0;str[i]!='\0';i++){if(str[i]>=97&&str[i]<=122)str[i]=str[i]-32;?? }cout<<str<<endl;return 0; }總結
以上是生活随笔為你收集整理的[YTU]_2803( 字符串中小写改大写)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [YTU]_2803( 判断字符串是否
- 下一篇: [YTU]_2781( 重复字符串)