手机扫描二维码答题
00:00:00
第4课 循环继续中断退出
录音中...
*
您的姓名:
*
1.
看程序写结果:
#include<iostream>
using namespace std;
int main(){
int i,j=0,s=0;
for(i=1;i<=5;i++){
if(i==4)break;
s++;
}
cout<<s;
return 0;
}
输出:
*
2.
#include<iostream>
using namespace std;
int main(){
int i,j=0,s=0;
for(i=1;i<=5;i++){
if(i==4)continue;
s++;
}
cout<<s;
return 0;
}
输出:
*
3.
#include<iostream>
using namespace std;
int main(){
int i,j=0,s=0;
for(i=1;i<=5;i++){
cout<<i<<" ";
if(i==4)return 0;
s++;
}
cout<<s;
return 0;
}
输出:
*
4.
#include<iostream>
using namespace std;
int main(){
int i,j=10,s=0;
for(i=3;i<=5;i++){
j--;
if(i==4)continue;
s++;
}
cout<<s;
return 0;
}
输出:
*
5.
#include<iostream>
using namespace std;
int main(){
int i,j=10,s=0;
for(i=1;i<=5;i++){
j--;
if(i==3)break;
s++;
}
cout<<j<<" "<<s;
return 0;
}
评价对象得分
字体大小