当前位置:网站首页>Consolidate -c operator
Consolidate -c operator
2022-07-01 11:58:00 【Jinan medical applet champion】
Foundation entry consolidation
#region Operator 071 The arithmetic Relationship Logic
// The arithmetic
int suan = 1;
int suan2 = 2;
int suan3 = suan + suan2;
Console.WriteLine(" Operator arithmetic operator addition calculation :{0}",suan3);
// Comparison operator == > <
// == Indicates that the results of the operation of the expressions on both sides are equal , Notice that there are two equal signs .
// such as 10 % 2 It's an expression . 0 Alone is an expression , Although only a number .
Console.WriteLine("10 Is it an even number ?!:"+ (10 % 2 ==0));
// For example, design 1 Expression . 5 Start divination at the third day of August in Xinsi year , The specific divination is as follows : The method of divination : number of years + Monthly number + days , Its sum is divided by eight , Mod , Divide by eight . Ren Yin Nian 3 Earth branch numbers , Lunar calendar 6 month , Digital 6, The third day of June .
// 3+6+3=12 % 8 = The result is false, How can I serve true?
Console.WriteLine(" Residual calculation results :"+(12 % 8 ==0.96));
// Logical operators
//【 example 2】 Judge 2017 Whether the year is a leap year .
// According to the title requirements , The judgment of leap year needs to meet one of two conditions , One is that the year can be 4 Integer but cannot be 100 Integers , One is that it can be 400 to be divisible by . The code is as follows .
Console.WriteLine(" Judge 2017 Whether the year is a leap year ?:"+((2017 % 4 ==0 && 2017 % 100 !=0 ) || (2017 % 400 ==0)));
Console.WriteLine(" Judge 2018 Whether the year is a leap year ?:" + ((2018 % 4 == 0 && 2018 % 100 != 0) || (2018 % 400 == 0)));
#endregion
effect
边栏推荐
- 2022/6/28学习总结
- About keil compiler, "file has been changed outside the editor, reload?" Solutions for
- How to make the development of liquidity pledge mining system, case analysis and source code of DAPP defi NFT LP liquidity pledge mining system development
- NOV Schedule for . Net to display and organize appointments and recurring events
- Neo4j 中文开发者月刊 - 202206期
- C summary of knowledge points 3
- 消息队列之监控退款任务批处理过程
- Kafuka learning path (I) Kafuka installation and simple use
- On recursion and Fibonacci sequence
- JS date format conversion method
猜你喜欢
The Missing Semester
Dlhsoft Kanban, Kanban component of WPF
C knowledge point form summary 2
How to set decimal places in CAD
Redis' attack tactics
使用set_handler过滤掉特定的SystemC Wraning &Error Message
消息队列之监控退款任务批处理过程
Exploration and practice of inress in kubernetes
[MCU] [nixie tube] nixie tube display
NOV Schedule for . Net to display and organize appointments and recurring events
随机推荐
Unity XLua 协程封装
Share the method of how to preview PSD format and PSD file thumbnail plug-in [easy to understand]
Golang根据参数引入相应配置文件的实现方式
Value/hush in redis
C # dependency injection (straight to the point) will be explained as soon as you see the series
Acly and metabolic diseases
JS date format conversion method
Istio、eBPF 和 RSocket Broker:深入研究服务网格
Computer graduation project asp Net hotel room management system VS development SQLSERVER database web structure c programming computer web page source code project
Harbor webhook from principle to construction
如何看懂开发的查询语句
How does Nike dominate the list all the year round? Here comes the answer to the latest financial report
Matrix of numpy
Force button homepage introduction animation
Dlhsoft Kanban, Kanban component of WPF
我在中山,到哪里开户比较好?实际上网上开户安全么?
Unity xlua co process packaging
使用set_handler过滤掉特定的SystemC Wraning &Error Message
Redis startup and library entry
Rural guys earn from more than 2000 a month to hundreds of thousands a year. Most brick movers can walk my way ǃ