- using ConsoleApp1;
- using System;//程式庫呼叫
- using System.ComponentModel.DataAnnotations;
- using System.Linq.Expressions;
- using ABC.qq;
- class Program//負責一部分工作的人
- {
- const string dreams = "There are moments in life when you miss someone so much that " +
- "you just want to pick them from your dreams and hug them for real! Dream what " +
- "you want to dream;go where you want to go;be what you want to be,because you have " +
- "only one life and one chance to do all the things you want to do";
- static void Main()//method ..Entry Point 程式進入點
- {
- try
- {
- string str = Console.ReadLine();
- for (int i = 0; i < str.Length; i++)
- {
- Char x = Convert.ToChar(str.Substring(i, 1));//每抓一個轉字元
- Console.WriteLine("ASCII code for '" + x + "' is " + Convert.ToByte(x).ToString());//將指定之數字的字串表示,轉換為相等的 8 位元不帶正負號的整數。
- }
- }
- catch
- {
- Console.WriteLine("error");
- }
- }
- }
複製代碼 |