using system;
using system.collections.Generic;
using system.Text;
namespace Text
{
class program
{
static void Main(string [] arge)
{
/*
这是一段提示信息
*/
console.writeline(每天都是美美哒);
}
}
}
}
using system.collections.Generic;
using system.Text;
namespace Text
{
class program
{
static void Main(string [] arge)
{
/*
这是一段提示信息
*/
console.writeline(每天都是美美哒);
}
}
}
}
x=2后 最后的循环条件 输出 3和4 为什么5也会输出 x=5 那(x>2&&x<=4)不就判定为false 那为什么会打印5 啊。。。
2017-04-28
int x = 1234;
int w =0;
int q =0;
int b=0;
int s=0;
while (x >= 0)//循环条件
{
w = (x % 10000 / 1000); //取千位
q = (x % 1000 / 100); //取百位
b = (x % 100 / 10); //取十位
s = (x % 10); //取个位
if (w + q + b + s == 7) //判断 (千位+百位+十位+个位)之和是否为7
Console.Write(x);
Console.Write(' ');
x--;
@慕娘512238
int w =0;
int q =0;
int b=0;
int s=0;
while (x >= 0)//循环条件
{
w = (x % 10000 / 1000); //取千位
q = (x % 1000 / 100); //取百位
b = (x % 100 / 10); //取十位
s = (x % 10); //取个位
if (w + q + b + s == 7) //判断 (千位+百位+十位+个位)之和是否为7
Console.Write(x);
Console.Write(' ');
x--;
@慕娘512238
2017-04-28
这个题有哪位大神会做的吗? 使用while循环打印出满足下列条件的值:处于100-10000之间并且各位数之和是7 (如241:2+4+1=7)初学不是太懂有会做的可以交流下
2017-04-27