快速C#运算符问题 [英] quick C# operator question

查看:89
本文介绍了快速C#运算符问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我有这笔钱



(11 + 22 + 33 + 44 + 55)%26



%26是什么意思?



我试过165除以26这给了我4.3



百分比等于相同......任何人都可以帮忙吗?



原谅我这是一个愚蠢的愚蠢问题要求

basically i have this sum

(11+22+33+44+55) % 26

what does the %26 mean?

i've tried 165 divided by 26 which gives me 6.3

percentage equals the same... can anyone help?

forgive me if this a stupidly idiotic question to ask

推荐答案

百分比是C#Modulus运算符: MDSN [ ^ ] - 当左侧是除以右边,并将其作为整数返回。



所以:

Percent is the C# Modulus operator: MDSN[^] - it returns the remainder when the left side is divided by the right, and returns it as an integer.

So:
12 % 10 == 2
12 %  8 == 4






And

(11+22+33+44+55) % 26 == 165 % 26 == 9







错字:转置数字 - OriginalGriff [/ edit]




[edit]Typo: transposed digits - OriginalGriff[/edit]


http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx [ ^ ]

这篇关于快速C#运算符问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆