题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-04 04:38:58

[单选题]阅读下面代码,输出结果为() int main() { char str1[] = "abc"; char str2[] = "abc"; const char str3[] = "abc"; const char str4[] = "abc"; const char *str5 = "abc"; const char *str6 = "abc"; cout<<boolalpha<<(str1 == str2)<<std::endl; cout<<boolalpha<<(str3 == str4)<<endl; cout<<boolalpha<<(str5 == str6)<<endl; return 0; }
A. true false true
B. false true true
C. false false false
D. false false true

更多"[单选题]阅读下面代码,输出结果为() int main() { c"的相关试题:

[单选题]下面代码的输出结果为 int func(int x) { int countx =0; while(x) { countx ++; x = x&(x-1); } return countx; } int main() { cout<A.255
B.8
C.12
D.6
[简答题]以下程序段的输出结果是 。
Int main()
{ char s[]= "abcdefg";
s[3] ='\0';
cout << s;
return 0;
}
[单选题]以下程序段运行后的输出结果是( )。
Int main()
{ char str[][9]={"hello", "student", "computer"};
cout << str[1];
return 0;
}
A. h
B. hello
C. student
D. computer
[单选题]现在有如下程序
Int main()
{ char s[80];
int i,j;
gets(s);
for(i=j=0;s[i]!=′\0′;i++)
if(s[i]!=′H′) ______
s[j]=′\0′;
puts(s);
return 0;
}
这个程序段的功能是删除输入的字符串中字符′H′,则空线上应当填入的是( )。
A. s[j++]=s[i]; j++;
B. s[j]=s[i++]; j++;
C. s[j++]=s[i];
D. s[j]=s[i];
[单选题]下面程序输出的结果是( )。
Int main()
{ int i;
int a[3][3]={1,2,3,4,5,6,7,8,9};
for(i=0;i<3;i++)
cout < return 0;
}
A. 1 5 9
B. 7 5 3
C. 3 5 7
D. 5 9 1
[单选题]请阅读下列代码:protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE://标志符 if (resultCode == RESULT_OK) { strReturnData = data.getStringExtra("password"); mTextView2.setText("第二个Activity传回的password:" + strReturnData); } break; default: }}。onActivityResult的作用是什么()?
A.处理第一个Activity的运行数据
B.处理第一个Activity传递给第二个Activity的运行数据
C.处理第二个Activity的运行数据
D.处理第二个Activity传回给第一个Activity的运行数据
[单选题]阅读下列代码 public class Person{ static int arr[ ] = new int[10]; public static void main (String[] args) { System.out.println(arr[9]); } } 该代码运行的结果是:
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出0
D.输出空
[单选题]有以下程序
Int main()
{ char a[]={ ′a′, ′b′, ′c′,′d′, ′e′, ′f′, ′g′,′h′,′\0′};
int i,j;
i=sizeof(a);
j=strlen(a);
cout << i << "," << j << endl;
Return 0;
}
程序运行后的输出结果是( )。
A. 9,9
B. 8,9
C. 1,8
D. 9,8
[多选题]下面代码实现了ListView的数据,请补全代码()?private int[] iPic = {R.drawable.door, R.drawable.lib, R.drawable.science, R.drawable.rest, R.drawable.lake, R.drawable.medium, R.drawable.night}; private String[] strName = {"大门", "图书馆", "科技楼", "宿舍楼", "天鹅湖", "体育场", "夜景"}; private String[] strContent = {"美丽大运村", "美丽图书馆", "美丽科技楼", "美丽宿舍楼", "美丽天鹅湖","美丽体育场", "美丽夜景"}; private ArrayList mArrayList; private void initData() { mArrayList=new ArrayList<>(); for (int i=0;iA.mItemBean.setiPic(iPic[i]);
B.mItemBean.setStrName(strName[i]);
C.map.put("content",strContent[i]);
D.mItemBean.setStrContent(strContent[i]);
[多选题] 下面代码实现了ListView的数据,请补全代码()?private int[] iPic = {R.drawable.door, R.drawable.lib, R.drawable.science, R.drawable.rest, R.drawable.lake, R.drawable.medium, R.drawable.night}; private String[] strName = {"大门", "图书馆", "科技楼", "宿舍楼", "天鹅湖", "体育场", "夜景"}; private String[] strContent = {"美丽大运村", "美丽图书馆", "美丽科技楼", "美丽宿舍楼", "美丽天鹅湖","美丽体育场", "美丽夜景"}; private ArrayList> mArrayList; private void initData() { mArrayList=new ArrayList<>(); for (int i=0;i map=new HashMap<>(); ( ? ) mArrayList.add(map); }
A.map.put("image",iPic[i]);
B.map.put("name",strName[i]);
C.map.put("content",strContent[i]);
D.map.put("person",strPerson[i]);
[简答题]完成下面输出字符串“world”的程序。
Int main( )
{ int i,j;
char c[]="hello world";
for(i=0;i<5;i++)
{ ;
cout << c[j];
}
return 0;
}
[单选题]下面代码的输出结果是:()
Public class Main {
Public static void main(String[] args) {
Int n1 = 1;
Int n2 = 2;
N1 = n1 + n2;
N2 = n1 - n2;
N1 = n1 - n2;
System.out.println(n1 + "," + n2);
}
}
A. 1,2
B. 2,1
C. 1,3
D. 3,2
[单选题]给出下面代码:
Public class Person{
Static int arr[] = new int[10];
Public static void main(String a[])
{
System.out.println(arr[1]);
}
}
哪个语句是正确的? ( )
A.编译时将产生错误;
B.输出零;
C.编译时正确,运行时将产生错误;
D.输出空。
[单选题]阅读以下代码,输出结果为() class A { public: virtual void a()=0; virtual ~A(){} }; class AA:public A { public: void a() { cout<<"nihao 2\n"; } ~AA() { cout<<"delete AA \n"; } }; class AAA:public AA { public: void a() { cout<<"nihao 3 \n"; } ~AAA() { cout<<"delete AAA \n"; } }; class B { public: A *b(int kind) { if(kind == 1) return new AA; else return new AAA; } ~B() { cout<<"delete B\n"; } }; int main() { B *bb = new B; A *aa = bb->b(1); aa->a(); aa = bb->b(2); aa->a(); delete aa; delete bb; return 0; }
A. nihao2 nihao3 delete AA delete AAA delete B
B. nihao3 nihao3 delete AAA delete AA delete B
C. nihao2 nihao2 delete AAA delete AA delete B
D. nihao2 nihao3 delete AAA delete AA delete B
[单选题]
(单选题)下面的代码输出的结果是()
Var name="Tom";
Function foo(){
Console.log(name);
Var name="Jerry";
Console.log(name);
}
Foo();
A.undefined
"Jerry"
B."Tom"
"Jerry"
C."Tom"
Undefined
D."Jerry"
"Jerry"
[单选题]阅读下马代码,运行结果为() class cls { public: int mi ; cls(int i):mi(i) { mi = i; cout<A.1
B.2
C.3
D.未知
[单选题]【单选题】
(单选题)下面的代码输出的结果是()
Var name="Tom";
Function foo(){
Console.log(name);
Var name="Jerry";
Console.log(name);
}
Foo();
A.undefined
"Jerry"
B."Tom"
"Jerry"
C."Tom"
Undefined
D."Jerry"
"Jerry"
[单选题]对于下面代码,描述正确的是 template class A { public: enum E{N = A::E::N * M}; }; template <> class A<1> { public: enum E{N = 1}; }; int main() { int a[A<4>::N]; return 0; }
A.编译错误,定义数组时下标必须为常量
B.能正确编译,数组a大小为24
C.能正确编译,数组a大小为4
D.能正确编译,数组a大小为10
[简答题]下面程序的功能是输出数组s中最大元素的下标,请填空。
Int main( )
{ int k, p,s[]={1, -9, 7, 2, -10, 3};
for ( p=0, k =p; p< 6; p++)
if (s[p]>s[k]) ; //注意:不要在运算符前后加空格
cout << k;
return 0;
}

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码