返回列表 發帖
  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.     static void Main()//method ..Entry Point 程式進入點
  9.     {
  10.         int x1, x2, x3;
  11.         Int32.TryParse(Console.ReadLine(), out x1);//字串轉整數
  12.         Int32.TryParse(Console.ReadLine(),out x2);
  13.         Int32.TryParse (Console.ReadLine(),out x3);
  14.         x1 = x1 < 0 ? 0 : x1;
  15.         x2=x2 < 0 ? 0 :x2;
  16.         x3 = x3 < 0 ? 0 : x3;
  17.         int total = x1 + (x2 * 5) + (x3 * 10);
  18.         Console.WriteLine(total.ToString("#,###"));
  19.         Console.ReadKey();
  20.     }

  21. }
複製代碼
istak.teach2@gmail.com

TOP

返回列表