c#一算法,会的来 比如给你一个数,这个数不确定,可能是带小数,也可能不带,要取如果整数的尾数是0-4的就取5,如果整数的尾数是5-9的就取0进1,比如35.69就是40了,如果是54.85就是55了。44的话就是45.急啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Math.Ceiling(12.56); 大小等于 参考:int i = 123;int j = (int)( Math.Ceiling((double) i / 10) * 10); // 结果 130 int process(float input){ int result = (int)input; if(result % 10 < 5) { result = (result % 10)*10 + 5; } else { result = ((result % 10) + 1 ) * 10; } return result;} int x = (int)num % 10;if(x < 5){ num = ((int)num / 10) * 10 + 5;}else if(x > 5){ num = ((int)num / 10) * 10 + 10;} 9楼的((result % 10) 是除不是取余哈10楼的对了 用C#做的一个小留方板的问题 这是不是C#的一个语言漏洞啊 (续) 关于.net外部环境 把下面的代码转换成LDAP://的 关于输出.txt文件加空格的问题! 怎样获取父div 的 ID? 怎么给DropDownList直接付值 迭代器问题 有个倒数据的问题 关于存储过程中检测到重复记录后返回怎么写!谢谢你 C#把一个access的表导入另一个mdb文件中. 诚心求助各位高人,一个时间范围的算法?
int i = 123;
int j = (int)( Math.Ceiling((double) i / 10) * 10); // 结果 130
{
int result = (int)input;
if(result % 10 < 5)
{
result = (result % 10)*10 + 5;
}
else
{
result = ((result % 10) + 1 ) * 10;
}
return result;
}
{
num = ((int)num / 10) * 10 + 5;
}
else if(x > 5)
{
num = ((int)num / 10) * 10 + 10;}