在筑堰之前,应做的准备工作是()。A.将堰底下河床底的树根、淤泥、石块及杂物清除干净B.砌筑可替代的
在筑堰之前,应做的准备工作是()。
A.将堰底下河床底的树根、淤泥、石块及杂物清除干净
B.砌筑可替代的挡土墙
C.用草皮、柴排、片石、草袋和土织物等加以防护
D.测定砌筑高度,计算土石方工程量,便于临时操作
在筑堰之前,应做的准备工作是()。
A.将堰底下河床底的树根、淤泥、石块及杂物清除干净
B.砌筑可替代的挡土墙
C.用草皮、柴排、片石、草袋和土织物等加以防护
D.测定砌筑高度,计算土石方工程量,便于临时操作
第1题
B.15
C.20
D.60
第2题
下列代码执行结果是 。 using namespace std; #include <iostream> int f(int Int) { if (Int==0) return 1; return (Int + f(Int-1)); } int main() { int inT=9; cout<< "result=" << f(inT) <<’\n’; return 0;> A、result=1
B、result=37
C、result=46
D、编译错误
第3题
请对以下程序进行插桩,显示循环执行的次数 public class GCD { public int getGCD(int x,int y){ if(x<1||x>100) { System.out.println("参数不正确!"); return -1; } if(y<1||y>100) { System.out.println("参数不正确!"); return -1; } int max,min,result = 1; if(x>=y) { max = x; min = y; } else { max = y; min = x; } for(int n=1;n<=min;n++) { if(min%n="=0&&max%n==0)" if(n>result) result = n; } } System.out.println("最大公约数为:"+result); return result; } }
第4题
A.cout$amp;
B.cOUt$amp;
C.COUt$amp;
D.cout$amp;;$lt;setfill(‘*’)$amp;
第5题
试针对如下程序代码设计测试脚本。 public class GCD { public int getGCD(int x,int y){ if(x<1||x>100) { System.out.println("数据超出范围!"); return -1; } if(y<1||y>100) { System.out.println("数据超出范围!"); return -1; } int max,min,result = 1; if(x>=y) { max = x; min = y; } else { max = y; min = x; } for(int n=1;n<=min;n++) { if(min%n="=0&&max%n==0)" if(n>result) result = n; } } System.out.println("因数:"+result); return result; } (1)设计测试脚本,对GCD类的getGCD方法实现语句覆盖测试。 (2)设计测试脚本,对GCD类的getGCD方法实现条件覆盖测试。
第6题
The first result is 5
The second result is 2
The third result is 2
The fourth result is 6
源程序文件test40_1.cpp清单如下:
include <iostream.h>
int subtraction (int a, int b)
{
int r;
r=a-b;
/***************** found ************************/
return &r;
}
int main ()
{
int x=5, y=3, z;
z = subtraction (7,2);
cout << "The first result is "<< z << '\n';
cout << "The second result is "<< subtraction(7,subtraction (7,2)) << '\n';
/**************** found *************************/
cout << "The third result is "<< subtraction (&x,&y) << '\n';
/***************** found ************************/
z= 4 + *subtraction (x,y);
cout << "The fourth result is "<< z << '\n';
return 0;
}
第7题
以下程序执行后输出的结果是【 】。
include<iostream>
using namespace std;
int fac(int a,int b){
return(b-a)*a;
}
int main(){
int x=3,y=4,z=5,result;
result=fac(fac(x,y),fac(x,z));
cout<<result<<endl;
return 0;
}
第8题
下列语句片段: int result; int a=17,b=6; result=(a%b>4) ? a%b:a/b; System.out.println(result);
A.0
B.1
C.2
D.5
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!