.Net基础篇_学习笔记_第四天_关系运算符和逻辑运算符
2024-10-05 16:56:34
1.关系运算符
包含:> < <= >= == !=
以及bool类型中的true和false。
2.逻辑运算符
与 &&
或 ||
非 !
注意:
逻辑运算符的两边放的一般都是关系表达式或者bool类型的值
3.复合运算符
+= -= *= /=
另外:扩充延伸.......
判断是否为闰年?
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("请输入要判断的年份:");
int year = Convert.ToInt32(Console.ReadLine());
//进行判断能被400或能被4但不能被100整除
bool b = (year % ==) || (year%==&&year%!=);
Console.WriteLine(b);
Console.ReadKey();
}
}
}
最新文章
- python serial 获取所有的串口名称
- 流的文件操作(File)
- [原创]WKWebview点击图片查看大图
- 连接linux数据库Oracle时报错ORA-12541: TNS: 无监听程序
- 初识ASP.NET CORE:一、HTTP pipeline
- js最新手机号码、电话号码正则表达式
- 50款免费名片设计模板 PSD 源文件下载《上篇》
- [HDOJ5542]The Battle of Chibi(DP,树状数组)
- Element can be click when out of view
- 2_1我的第一个应用hello world[wp8特色开发与编程技巧]
- 在安卓开发中使用SQLite数据库操作实例
- 使用JAVA与SmartFoxServer来实现游戏服务器概述
- 【图文详解】HDFS基本原理
- 关于Random(47)与randon.nextInt(100)的区别
- 聚焦“云开发圆桌论坛”,大前端Serverless大佬们释放了这些讯号!
- android---EventBus的简单使用(一)
- Git基本原理-hash算法
- php生成红包
- 【Tomcat】详解tomcat的连接数与线程池
- 【转】Python中的运算符