返回列表 發帖
  1. using ConsoleApp1;
  2. using System;//程式庫呼叫
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Linq.Expressions;
  5. using ABC.qq;


  6. class Program//負責一部分工作的人
  7. {
  8.     const string dreams = "There are moments in life when you miss someone so much that " +
  9.     "you just want to pick them from your dreams and hug them for real! Dream what " +
  10.     "you want to dream;go where you want to go;be what you want to be,because you have " +
  11.     "only one life and one chance to do all the things you want to do";
  12.     static void Main()//method ..Entry Point 程式進入點
  13.     {

  14.         try
  15.         {
  16.             string str = Console.ReadLine();
  17.             for (int i = 0; i < str.Length; i++)
  18.             {
  19.                 Char x = Convert.ToChar(str.Substring(i, 1));//每抓一個轉字元
  20.                 Console.WriteLine("ASCII code for '" + x + "' is " + Convert.ToByte(x).ToString());//將指定之數字的字串表示,轉換為相等的 8 位元不帶正負號的整數。
  21.             }
  22.         }
  23.         catch
  24.         {
  25.             Console.WriteLine("error");
  26.         }
  27.     }
  28. }
複製代碼
istak.teach2@gmail.com

TOP

返回列表