* 做一个类似注册的一个界面
用户名 密码 性别 年龄 工资家庭住址 是否已婚
打印出这样的内容"谢谢{0}的配合,请确认您的用户名{1},密码:{2},性别:{3},婚姻:{4},其他信息我们将会做为隐私!!"
*/
static void Main(string[] args)
{
Console.WriteLine("请输入用户名:");
string username =Console.ReadLine(); //字符串
Console.WriteLine("请输入密码:");
string password =Console.ReadLine(); //字符串
Console.WriteLine("请输入性别:");
char gender =char.Parse(Console.ReadLine()); //只有string类型的不用转化,其他的都转化
【//string genderStr = Console.ReadLine();
// char gender = char.Parse(genderStr); 这两行和上面的一行功能一样,可写上面的一行】
Console.WriteLine("请输入年龄:");
int age =int.Parse(Console.ReadLine()); //int也转化
Console.WriteLine("请输入您的薪资");
double salary =double.Parse(Console.ReadLine()); //double也转化
Console.WriteLine("请输入家庭住址");
string address =Console.ReadLine();
Console.WriteLine("是否已婚");
bool isMarray =bool.Parse(Console.ReadLine()); // bool也转化,最后控制面板输出时只输入true或false
Console.WriteLine("谢谢{0}的配合,请确认您的用户名{0},密码:{1},性别:{2},婚姻:{3},其他信息我们将会做为隐私!!", username, password, gender, isMarray); //优化了因为用户名,因为一样,可都定义{0},后面只输入一个username即可。