C++ 编写一个程序提示用户从键盘输入两个整数

2025-06-28 01:05:43
推荐回答(3个)
回答1:

#include
using namespace std;
int main()
{
int a,b;
cout<<"输入a,b值:"< cin>>a>>b;
int c=a%b;
if(0==c)
cout<<"YES"< else
cout<<"NO"< return 0;
}
我发现我就是雷锋,纪念那些年一起作弊的我们

回答2:

好简单啊
#include
int main(void)
{
using namespace std;
int a,b;
cin>>a>>b;
if( a%b==0)
cout<<"YES"<else
cout<<"NO"<system("pause");
return 0;
}

btw,他妈的考试怎么这么简单,我擦

回答3:

#include
using namespace std;
int main()
{
int a = 0;
int b = 0;
cout << "请输入整数a:" << endl;
cin >> a;
cout << "请输入整数b:" << endl;
cin >> b;
if (a % b == 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
}