-2
我必須寫一個程序中,鍵入三個名字後,應該回答我,「你好!」,但與Console.WriteLine命令功能問題...我必須寫一個程序,在輸入三個名字後,它應該回答我「你好<firstName>!」
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace homework1
{
class Program
{
static int Main()
{
string firstName = Console.ReadLine();
string surName = Console.ReadLine();
string lastName = Console.ReadLine();
Console.WriteLine("Hello, " + firstName[] + "!");
//Console.WriteLine("Your full name is " + fullName + ".");
}
}
}
任何理由使用的firstName'[]''而不是firstName'? –