Synchronization of old projects
Part1
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
namespace Lessson11_exercise
|
||||
{
|
||||
class program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string customerName = "张三";
|
||||
Console.WriteLine("你好,{0}",customerName);
|
||||
Console.WriteLine();
|
||||
|
||||
string customerName2 = "李四";
|
||||
int customerAge = 25;
|
||||
Console.WriteLine("{0}今年{1}岁了\n", customerName2,customerAge);
|
||||
|
||||
string name = "小明";
|
||||
int age = 20;
|
||||
string email = "123@gmail.com";
|
||||
string address = "北京市朝阳区某街道某小区";
|
||||
string phone = "12345678901";
|
||||
Console.WriteLine("姓名:{0}\n年龄:{1}\n邮箱:{2}\n地址:{3}\n电话:{4}\n", name, age, email, address, phone);
|
||||
|
||||
string username;
|
||||
int age1;
|
||||
string classes;
|
||||
Console.WriteLine("请输入你的用户名:");
|
||||
username = Console.ReadLine();
|
||||
Console.WriteLine("请输入你的年龄:");
|
||||
age1 = Convert.ToInt32(Console.ReadLine());
|
||||
Console.WriteLine("请输入你的班级:");
|
||||
classes = Console.ReadLine();
|
||||
Console.WriteLine("你是{0}\n你今年{1}岁了\n班级是{2}\n",username,age1,classes);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user