using namespace std
int main()
{
cout<<"请输入整数:"
int number
cin>>number
if(number<0)
cout<<"输入的数:"<<number<<"为负数"<<endl
else
cout<<"输入的数:"<<number<<"为正数"<<endl
if(number%2==0)
cout<<"输入的数:"<<number<<"为偶数"<<endl
else
cout<<"输入的数:"<<number<<"为奇数"<<endl
return 0
}
Dim i As Integeri = Val(InputBox("请输入整数"))
If i 0 Then
If i Mod 2 = 0 Then
MsgBox "你输入的是偶数"
Else
MsgBox "你输入的是奇数"
End If
End If
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)