C#运算符
1,算术运算符
+、-、*、/、%、
++、–
分为两种情况:(1)i++/i–先赋值后运算
(2)++i/–i先运算后赋值
2,关系运算符
==、!=、>、<、>=、<=
3,逻辑运算符
&&与 ||或 !非
判断
1,判断语句
①if语句
(1)一个if
if(条件){
语句体
}
(2)if…else
if(条件){
语句体1
}
else{
"上面条件为假时执行"
}
气球屏保案例1
挨边跑
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 运算符
{
public partial class Form8 : Form
{
public Form8()
{
InitializeComponent();
}
Timer time = new Timer();
//实例化 创建一个新对象
Label lb = new Label();
private void Form8_Load(object sender, EventArgs e)
{
//this.WindowState = FormWindowState.Maximized;
//this.FormBorderStyle = FormBorderStyle.None;
//lb.Text = "Hello World!";
//lb.Font &