1:代码如下:

// 3.9.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> using namespace std; void main() { int iInput; cout << "输入一个整数" << endl; cin >> iInput; //从键盘中输入一个数 (iInput%3==0)? ((iInput%5==0) ? cout << "yes" : cout << "no" ) : cout << "no"; cout << endl; }
运行结果: