下面程序的输出结果是()。 s="Hi,Python" #逗号为英文符号 s.replace("Hi","Hello") print(s) 提示:注意大小写,字符串中间不要添加多余空格
下面程序的输出结果是()。 s="Hi,Python" #逗号为英文符号 s.replace("Hi","Hello") print(s) 提示:注意大小写,字符串中间不要添加多余空格
参考答案和解析
D 函数的功能是将数组的元素交换,首先s1=p,即s1指向1,s2=p+7-1,即s2指向7,t=*s1++,将1赋给t,然后s1指向2,*s1=*s2++,将7赋给s1,即原来2的位置,s2指向6,然后*s2=t,将1赋给*s2即原来6的位置,…….
相关考题:
有以下程序 #includestdio.h void fun(char*c) {while(*c) {if(*c=a*c=z)*c=*c=(’a’-’A’) c++; } } main( ) {char s[81]; gets(s);fun(;)puts(s); 当执行程序时从键盘输入Hello Beijing回车,则程序的输出结果是( )。A.hello beijingB.Hello BeijingC.HELLO BEIJINGD.hELLO Beijing
下面程序的输出结果是什么? class Foo{ static void change(String s){ s=s.replace('j','l'); } public static void main(String args[]){ String s="java"; change(s); System.out.println(s); } }()A.lavaB.javaC.编译错误D.运行时出现异常
–– James: Hi, Harry. ____–– Harry: Hi, James. I just bought a new camping tent. I can ’t wait to use it.A: What’s up?B: What’s on?C: What’s wrong?D: What’s right?
A:( ).B:Hi. My name's Rose. Are you from London?A. Hello, I'm Paul. What's your name?B. Hello, who are you? What's your name?C. Where are you from?
When introduced to an older professor or to a friend's parents, what would you say?A、" How are you?B、" Hello" and bow.C、" Hi! Glad to know you."D、"Hello, it's nice to meet you", and then shake hands.
以下程序的输出结果是()。includeusing namespace std;void fun(char**q){++q;cout 以下程序的输出结果是( )。 #include<iostream> using namespace std; void fun(char**q) { ++q; cout<<*q<<end1; } main() { static char*s[]={"HI","HELL0","TEST"}; char**p; p=s; fun(p); system("PAUSE"); return 0; }A.为空B.HIC.HELL0D.TEST
以下程序的输出结果是 ______。includeincludevoidmain(){char *p1=",he 以下程序的输出结果是 ______。 #include<iostream.h> #include<string.h> void main(){ char *p1=",hello",*p2="world!",str[50]:"Hii"; strcpy(str+2,p1); strcat(str,p2); cout<<str; }A.Hii,hello world!B.hello world!C.ii,hello world!D.Hi,hello world!
当运行以下程序时,从键盘输入AhaMA(空格)Aha,则下面程序的运行结果是includemain( 当运行以下程序时,从键盘输入AhaMA(空格)Aha<CR>,则下面程序的运行结果是 #include<stdio.h> main() {char s[80],c='a'; int i=0; scanf("%s",s); while(s[i]!='\n\) {if(s[i]]==c)s[i]-32; else if(s[i]==c-32)s[i]=s[i]+32; i++;} puts(s);}A.ahaMaB.AbAMaC.A11AMa[空格]ahaD.ahAMa[空格]ahA
下面程序的输出结果是 ( ) char b[]="ABCD"; main() { char * chp; for ( chp=b; * chp;chp + =2 )printf("%s",chp); print{("\n"); }A.ABABCDB.ABCDABC.ABCDDD.ABCDCD
有以下程序#includestdio.hvoid fun(char*c){while(*C){if(*c=‘a’&&*c=‘z’) *c=*c一(‘a’一‘A’);C++;}}main(){char s[81];gets(s);fun(s);puts(s);}当执行程序时从键盘上输入Hello Beijing回车,则程序的输出结果是A.hello beijingB.Hello BeijingC.HELLO BEIJINGD.hELLO Beijing
语句“printf("akbre"\hi\y\\\bou\n")”;的输出结果是( )。A.akbre\hi\y \\\bouB.a\bre\hi\\y\bouC.re hiyouD.abrehiy\bou
下列语句的输出结果是______。 (说明:'\b'是退格符)printf("a\bre\'hi\'y\\\bou\n");A.a\bre\'hi\'y\\\bouB.a\bre\'hi\'y\bouC.re'hi'youD.abre'hi'y\bou
有以下程序#includevoid fun(char *c){ while(*c){ if(*c=a*c=z) *c=*c-(a-A);c++;}}main(){ char s[81];gets(s); fun(s); puts(s):}当执行程序时从键盘上输入Hello Beijing回车,则程序的输出结果是A.hello beijingB.Hello BeijingC.HELLO BEIJINGD.hELLO Beijing
下面程序运行后输出结果是( )。 For I=1 to 2 S=1 For j=0 to I-1 S=S+S*I Next j Print S Next IA.1 1B.0 2C.2 9D.6 9
下列程序的输出结果是( )。 public class Test { public static void main (String[] args) { String s="hello"; s.replace ('r','m'); System.out.println(s); } }A.helloB.HELLOC.hemmoD.HEMMO
给出下面程序: public class ex51 { public static void main(String[] args) { String s = "hello"; String t = "hello"; char c[] = {'h', 'e', '1', '1', 'o'}; System. out. println (______) } } 在程序的横线处填入下列______选项后,程序输出的结果是true。A.t.equals(c)B.s.equals?C.s == tD.t == c
(29)有以下程序include stdio.hvoid fun(char *c){ while(*c){ if(*c='a'stdio.hvoid fun(char *c){ while(*c){ if(*c='a'*c='z') *c=*c-('a'-'A');c++;}}main(){ char s[81];gets(s); fun(s); puts(s):}当执行程序时从键盘上输入Hello Beijing回车,则程序的输出结果是A)hello beijingB)Hello BeijingC)HELLO BEIJINGD)hELLO Beijing
语句printf("a/bre/’hi/’y///bou/n");的输出结果是(说明:’/b’是退格符)().A、a/bre/’hi/’y///bouB、a/bre/’hi/’y/bouC、re’hi’youD、abre’hi’y/bou
设原字符串s为StringBuffer型,且s="Hellojava",如果想用子串替换把s转换成"HelloWorld",则正确的语句是()A、s.replace(6,9,"World");B、s.replace(6,10,"World");C、s="World";D、s=replace("java","World");
“您好,请问到那里?”翻译为:()A、Hi,where are you?B、Hello,where are you going to?C、Hello,where are you going?D、Hi,where to go?
填空题已知字符串x=’helloworld’,那么执行语句x.replace(’hello’,’hi’)之后,x的值为()。