小写字母变为大写字母
Time Limit:2000MS Memory Limit:65536K
Total Submit:225 Accepted:171
Description
写一个程序把一个字符串(可能含有空格,长度最长不超过1000)
中的小写字母转化为大写字母。
Input
输入只有一行,可以包含数字大小写字母
Output
同样是一串字符串,只是将输入串中的小写字母转换成大写输出,其他不变
Sample Input
样例输入:
abcABC abcxyz123
Sample Output
样例输出:
ABCABC ABCXYZ123
Source
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AK1125 {
class Program {
static void Main(string[] args) {
string sb = Console.ReadLine();
for (int i = 0; i < sb.Length; i++) {
if (sb[i] >= 'a' && sb[i] <= 'z')
Console.Write(sb[i].ToString().ToUpper());
else
Console.Write(sb[i]);
}
Console.WriteLine();
//Console.ReadLine();
}
}
}