📜  将 g 转换为 kg - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:37.850000             🧑  作者: Mango

代码示例1
using System;

class MainClass {
  public static void Main (string[] args) {
    Console.WriteLine ("Please enter grams:");
    double grams = Convert.ToDouble(Console.ReadLine());
    double kilograms = grams / 1000;
    Console.WriteLine(kilograms + " Kilograms");
  }
}