代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ConsoleExamples
{
static class Program
{
///
/// 应用程序的主入口点。
///
[STAThread]
static void Main(string[] args)
{
Console.Write("请输入x和y(例如12,15),然后按回车键:");
string s = Console.ReadLine();
string[] a = s.Split(',');
int x = int.Parse(a[0]);
int y = int.Parse(a[1]);
int z = x * y;
Console.WriteLine("x*y={0}", z);
Console.WriteLine("请按任意键结束程序。");
Console.ReadKey();
}
}
}