Console.WriteLine("请输入两个数");
int a, b; //定义变量
a = Convert.ToInt32(Console.Read()); //接收数值a
b = Convert.ToInt32(Console.Read()); //接收数值b
///判断结果
{
if (a % b == 0)
Console.WriteLine("第一个整数是第二的倍数");
else
Console.WriteLine("第一个整数不是第二的倍数");
}上面的程序是用户输入两个值,然后判断第一个值是不是第二值的倍数。
int a, b; //定义变量
a = Convert.ToInt32(Console.Read()); //接收数值a
b = Convert.ToInt32(Console.Read()); //接收数值b
///判断结果
{
if (a % b == 0)
Console.WriteLine("第一个整数是第二的倍数");
else
Console.WriteLine("第一个整数不是第二的倍数");
}上面的程序是用户输入两个值,然后判断第一个值是不是第二值的倍数。
解决方案 »
- 关于图片旋转的顺时针快还是逆时针快的问题。
- Cannot create instance of 'WindowProject' defined in assembly
- 如何用jquery 去除一个文本框内容的空格
- 如何取得gridview 中dropdownlist选中项
- 请问应该如何消除以下两类警告?
- 当点击DataGrid中的行时的问题,
- 那里有net 2003下载
- 如何用C#实现远程控制
- 像资源管理器那种效果,并列的两个窗口,可以通过拖动中间分隔来调整大小,是怎么做到的?
- vs2015c#查询oracle10g乱码
- 》》》C#把简单的问题搞复杂了,位运算的数据类型问题!!!
- 请教:如果用应用程序安装CAB包
a = Convert.ToInt32(Console.ReadLine()); //接收数值a
b = Convert.ToInt32(Console.ReadLine()); //接收数值b
int a, b; //定义变量
a = Convert.ToInt32(Console.ReadLine()); //接收数值a
Console.WriteLine("请输入第二个数");
b = Convert.ToInt32(Console.ReadLine()); //接收数值b
if (a % b == 0)
Console.WriteLine("第一个整数是第二的倍数");
else
Console.WriteLine("第一个整数不是第二的倍数");
b = Convert.ToInt32(Console.ReadLine());
int a, b; //定义变量
a = Convert.ToInt32(Console.ReadLine()); //接收数值a
Console.WriteLine("请输入第二个数");
b = Convert.ToInt32(Console.ReadLine()); //接收数值b
if(b==0)
Console.WriteLine("被除数不能为0"); //判断B不能为0
if (a % b == 0)
Console.WriteLine("第一个整数是第二的倍数");
else
Console.WriteLine("第一个整数不是第二的倍数");