P11 IF判断(上) P11 IF判断(中 )
bool→true or false;
=为:变量赋值
=+=为:等于(判断)
!+=为:≠
优先级:==大于=
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace C_8_1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("公司名称:");
string name = Console.ReadLine();
bool ischeck = name == "fortec";
if(ischeck)
{
name = "公司名称为:Fortec";
}
//Console.WriteLine("今天日期:");
//string data = Console.ReadLine();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("最终结果" + name);
//Console.WriteLine("今天的日期为" + data);
Console.ReadKey();
}
}
}