using System;
using System. Collections. Generic;
using System. Linq;
using System. Text;
using System. Threading. Tasks;
namespace 课堂
{
class Program
{
static void Main ( string [ ] args)
{
int age = 18 ;
string name = "张三" ;
bool isSmoker = true ;
Console. WriteLine ( name) ;
string con = Console. ReadLine ( ) ;
Console. WriteLine ( con) ;
Console. ReadKey ( ) ;
}
}
}
using System;
using System. Collections. Generic;
using System. Linq;
using System. Text;
using System. Threading. Tasks;
namespace 常量
{
class Program
{
static void Main ( string [ ] args)
{
int a = 1 ;
Console. WriteLine ( a) ;
a++ ;
const int b = 20 ;
Console. WriteLine ( b) ;
Console. ReadKey ( ) ;
}
}
}
using System;
using System. Collections. Generic;
using System. Linq;
using System. Text;
using System. Threading. Tasks;
namespace 格式化输出内容
{
class Program
{
static void Main ( string [ ] args)
{
Console. WriteLine ( "请输入姓名" ) ;
string name = Console. ReadLine ( ) ;
Console. WriteLine ( "请输入出生地" ) ;
string place = Console. ReadLine ( ) ;
Console. WriteLine ( "请输入年龄" ) ;
string gender = Console. ReadLine ( ) ;
Console. WriteLine ( "请输入性别" ) ;
string nan = Console. ReadLine ( ) ;
Console. WriteLine ( " 姓名 " + name + " 出生地 " + place + " 年龄 " + gender + " 性别 " + nan) ;
Console. WriteLine ( "姓名{0}出生地{1}" , name, place) ;
Console. ReadLine ( ) ;
}
}
}