![](https://lstatic.shangxueba.com/jiandati/pc/images/pc_jdt_tittleico.png)
运行下列程序main(){char ch='B';printf("%c%d",ch,ch++);}的输出是()
A.C65
B. B65
C. B66
D. C66
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_q_ckda.png)
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_panel_vip.png)
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_q_wyda.png)
- · 有5位网友选择 B,占比45.45%
- · 有2位网友选择 D,占比18.18%
- · 有2位网友选择 A,占比18.18%
- · 有2位网友选择 C,占比18.18%
A.C65
B. B65
C. B66
D. C66
下列程序运行后的输出结果是______。
#include<stdio.h>
main()
{ char ch[7]="56bcl2";
int i,s=0;
for(i=0;ch[i]>='0'&&ch[i]<='9';i++)
s=10*s+ch[i]-'0';
printf("s=%d\n",s);
}
#include
main()
{ char ch[7]="56bcl2";
int i,s=0;
for(i=0;ch[i]>='0'&&ch[i]<='9';i++)
s=10*s+ch[i]-'0';
printf("s=%d\n",s);
}
指出下列程序运行的结果 public class Example { String str = new String("good"); char[] ch = { ’a’, ’b’, ’c’ }; public static void main(String args[]) { Example ex = new Example(); ex.change(ex.str, ex.ch); System.out.print(ex.str + " and "); System.out.print(ex.ch); } public void change(String str, char ch[]) { str = "test ok"; ch[0] = ’g’; } }
A、good and abc
B、good and gbc
C、test ok and abc
D、test ok and gbc
假设文本文件中已经存有“ILOVECHINA”九个字符,则下列程序的运行结果是 。 void main(void) { fstream file("letters.txt",ios::in); char ch; if (!file) exit(0); file.seekg (1L, ios::beg); file.get(ch); cout << ch << endl; file.seekg (-4L, ios::end); file.get(ch); cout << ch << endl; file.seekg (2L, ios::cur); file.get(ch); cout << ch << endl; file.close(); }
阅读下列程序,则在执行后,程序的运行结果为
#include "stdio.h"
#include "string.h"
main()
{ char a[30]="nice to meet you!";
strcpy(a+strlen(a)/2,"you");
printf("%s\n",a);}
A.nice to meet you you
B.nice to
C.meet you you
D.nice to you
A.6
B.6521
C.12ba56
D.62
下列程序运行后,输出结果是______。main(){ char ch[2][5]={"693","825"),*p[2]; int i,j,s=0; for (i=0;i<2;i++) p[i]=ch[i]; for (i=0;i<2;i++) for (j=0;p[i][j]>='0' &&p[i][j]<='9';j+=2) s=10*s+p[i][j]-'0'; printf("%d\n",s);}
A.6385
B.22
C.33
D.693825
指出下列程序运行的结果 () 。public class Example{ String str=new String("good"); char[]ch={'a','b','c'}; public static void main(String args[]){ Example ex=new Example(); ex.change(ex.otr,ex.ch); System.out.print(ex.str+"and"); System.out.print(ex.ch); } public void change(String str,char ch[])} str="test ok"; ch[0]≈'g'; } }
A.good and abc
B.good and gbc
C.test ok and abc
D.test ok and gbc
下面程序的运行结果是______。
#include<stdio.h>
main()
{ char ch[7]=("65ab21");
int i,s=0;
for(i=0;ch[i]>='0'&&ch[i]<'9'; i+=2)
s=10*s+ch[i]-'0';
printf("%d\n",s);
}
假设文本文件letters.txt中已经存有“1234567890”十个字符,则下列程序的运行结果是 。 #include <fstream.h> #include <stdlib.h> void main(void) { fstream file("nums.txt",ios::in); char ch; if (!file) exit(0); file.seekg (1L, ios::beg); file.get(ch); cout << ch << endl; file.seekg (-5L, ios::end); file.get(ch); cout << ch << endl; file.seekg (-2L, ios::cur); file.get(ch); cout << ch << endl; file.close(); }
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!