老李大叔

导航

公告

统计

2011年12月15日 #

[新手]显示大小写字母的ASCII码

 1  using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace ASCII
7 {
8 class Program
9 {
10 static void Main(string[] args)
11 {
12 Console.WriteLine("字母\tASCII");
13 for (char i = 'A'; i <= 'z'; i++)
14 {
15 if (((i >= 'a') && (i <= 'z'))|| ((i >= 'A') && (i <= 'Z')))
16 {
17 Console.WriteLine("{0}\t{1}", i, Convert.ToInt32(i));
18 }
19
20 }
21 Console.ReadKey();
22 }
23 }
24 }

 

posted @ 2011-12-15 19:35 老李大叔 阅读(50) 评论(0) 编辑