第2课 判断结构

*
您的姓名:
*
1.
看程序写结果:
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
if(n%3!=0)
cout<<"yes";
else
cout<<"no";
return 0;
}
输入:25
输出:
*
2.
看程序写结果:
#include<iostream>
using namespace std;
int main(){
int a,b,c,s;
cin>>a>>b>>c;
if(a+b==c&&c%3==0)cout<<"yes";else cout<<"no";
return 0;
}
输入:5 2 7
输出:
*
3.
看程序写结果:
#include<iostream>
using namespace std;
int main(){
int a,b,c,d,s;
cin>>a>>b>>c>>d;
s=a;
if(b<s)s=b;
if(c<s)s=c;
if(d<s)s=c;
cout<<s;
return 0;
}
输入:4 3 8 5
输出:
*
4.
看程序写结果:

#include<iostream>

using namespace std;

int main(){

int a,b,c,s;

cin>>a>>b>>c;

if(a<b){

if(a<c)cout<<a;

else cout<<c;

}else{

if(b<c)cout<<b;

else cout<<c;

}

return 0;

}

输入:5 2 7

输出:
*
5.
看程序写结果:

#include<iostream>

using namespace std;

int main(){

int a,b,c,s;

cin>>a>>b>>c;

if(a+b==c||c%a==0)cout<<"yes";else cout<<"no";

return 0;

}

输入:5 2 7

输出:
问卷星提供技术支持
举报