网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

18、下面代码的结果是什么? s ="\t\tWelcome\n" print(s.strip())

A.\t\twelcome\n

B.\t\tWelcome\n

C.\t\tWELCOME\n

D.Welcome


参考答案和解析
False
更多 “18、下面代码的结果是什么? s ="\t\tWelcome\n" print(s.strip())A.\t\twelcome\nB.\t\tWelcome\nC.\t\tWELCOME\nD.Welcome” 相关考题
考题 有如下程序,运行输出的结果是 ______ 。 s=0 Do s=(s+1)*(s+2) n=n+1 Loop Until s>=30 Print n; sA.0 1B.30 30C.4 30D.3 182

考题 执行下面的程序,输出的结果是 ______ 。 Private Sub Command1_Click() ch $ = "Welcome to China!" n = Len(ch $ ) For i =1 To n-1 s$ =Mid(ch$ ,i,1) If s$ ="o" Then m=m + 1 Next i Print m End SubA.1B.2C.8D.0

考题 下面程序的运行结果为#includeclass A{static int n;public:A(){n=1;}A(int num){n=num;}void print(){coot }int A::n=2:void main(){A a.b(3);a.print();b.pint();cout }A.11B.13C.23D.33

考题 下面程序的运行结果为 include Class Astatic int n; public: A( ) {n=1;} A(int n 下面程序的运行结果为#include<iostream.h>Class Astatic int n;public:A( ) {n=1;}A(int num) {n=num;}void print( ) {cout < < n;}};int A: :n=2;void main( ){A a,b(3) ;a. print( ) ;b. print( ) ;cout < < endl;}A.11B.13C.23D.33

考题 下面运行程序后,单击命令按钮,输出的结果是 【 】 。Private Sub Command1_Click()Dim a%(1 To 5),i%, s#For i=1 To 5a(i)=iNexts=Fun(a)Print "s="; s;End SubFunction Fun(a() As Integer)Dim t#, i%t=1For i=LBound(a) To UBound(a)t=t  a(i)NextFun=tEnd Function

考题 哪个选项是下面代码的执行结果()s='PYTHON'print("{0:3}".format(s)) A、PYTHONB、PYTC、PYTHD、PYTHON

考题 下列程序中声明了两个类AA和BB,其中函数“print”是类AA的成员函数,但是类BB的友元函数。请在①、②和⑧处各填入正确的内容,使程序能正常运行。include<iostream.h>【 】;class AA{int t;public:AA(int x){t=x;}void print(BB b) ;};class BB{int s;public:BB(int y){s=y;}friend void 【 】 print(BB );};void 【 】{ cout<<"AA:"<<t<<"BB: "<<w.s<<end1;}<void main(){AA m(6);BB n(8);m.print(n);}输出结果为:AA:6;BB:8

考题 阅读以下说明和C++码,将相应的文字填入(n)处,写在对应栏内。[说明]以下代码实现了对象引用作为函数参数,仔细阅读以下代码,分析运行结果,填入(n)处。[代码]include<iostream.h>class Sample{int x,y;public:Sample() {x=y=0; }Sample (int i, int j ) {x=i; y=j; }void copy ( Sample s ).,void setxy ( int i, int j ) {x=i; y=j; }void print ( {cout<<"x="<<x<<end1 ; cout <<"y="<<y<<end1;};void Sample: copy ( Sample s ){X=S.X;y=s.y;}void func ( Sample s1, Sample s2 ){s1.setxy ( 10,20 );s2.setxy ( 30,40 );}void main ( ){Sample p ( 1,2 ) ,q;q.copy ( p );time ( p,q );p.print ( );q.print ( );}运行结果(1)(2)(3)(4)

考题 阅读下面代码 public class Test2005 { public static void main(String args[]) { String s="Test"; switch(s) { case"Java":System.out.print("Java"); break; case"Language":System.out.print("Language"): break; case"Test":System.out.print("Test"); break; } } } 其运行结果是A.JavaB.LanguageC.TestD.编译出错

考题 单击命令按钮之后,下列程序代码的执行结果为______。 Private Function P(N As Integer) Static sum For I=I To N Sum = sum +1 Next I P =sum End Function Private Sub Command1_Click() S=P(1)+P(2)+P(3)+P(4) Print S: End SubA.20B.30C.115D.135

考题 下面程序的运行结果为( )。 class A{ static int n; public: A(){n=1;} A(int num){n=num;} void print(){cout<<n;} } A::n=0; void main(){ A a,b(2); a.print(); b.pint(); }A.12B.11C.22D.21

考题 单击命令按钮时,下列程序代码的运行结果为 Private Sub Command1_Click() Print MyFunc(20, 18) End Sub Public Function MyFunc(m As Integer, n As Integer)As Integer Do While m<>n Do While m>n:m=m-n:Loop Do Whle m<n:n=n-m:Loop Loop MyFunc=m End FunctionA.0B.2C.4D.6

考题 先有两个C程序文件T18.c和myfun.c同在TC系统目录(文件夹)下,其中T18.c文件 如下: include<stdio.h> include"myfun.C" main() {fun();printf("\n");} //myfun.c文件如下: void fun() { char s[80],c;int n=0; while((c=getchar())!='\n') s[n++]=c; n--; while(n>=0)printf("%c",s[n--]); } 当编译连接通过后,运行程序T18时,输入Hello!则输出结果是( )。

考题 下面程序的运行结果是( )。 include main() {int a,s,n,m; a=2;s=0;n=1;m=1; while(m 下面程序的运行结果是( )。 include<stdio.h> main() {int a,s,n,m; a=2;s=0;n=1;m=1; while(m<=4){n=n*a;s=s+n;++m;} printf("s=%d",s); }

考题 下面程序的输出结果是 ( ) char b[]="ABCD"; main() { char * chp; for ( chp=b; * chp;chp + =2 )printf("%s",chp); print{("\n"); }A.ABABCDB.ABCDABC.ABCDDD.ABCDCD

考题 下面程序的运行结果为include class A{ static int n;public:A( ){n=1;}A(int nu 下面程序的运行结果为 #include < iostream.h > class A { static int n; public: A( ){n=1;} A(int num){ n = num;} void print( ){cout<< n;} }; int A::n=2; void main( ) { A a,b (3); a.print( ); b.print( ); cout<< end1; }A.11B.13C.23D.33

考题 What’s the final result?(下面这段代码的最终运行结果是什么)double expectedValue = 1/2;if(expectedValue 0){expectedValue = expectedValue + 0.5;}Console.WriteLine(expectedValue);

考题 下面程序运行后的结果是( )。 Private Sub Form_Click() Dim s As Integer,k As Integer,i As Integer,n As Integer s=1 fori=1 to 3 forj=i to 3 for k=j to istep-1 s=s*k nextk,J,i print s End SubA.6B.72C.144D.432

考题 下面程序的运行结果为includeclass A{static int n;public: A(){n=1;} A(intnum){n 下面程序的运行结果为 #include<iostream.h> class A { static int n; public: A(){n=1;} A(intnum){n=num;} void print(){cout <<n;} }; int A∷n=2; void main() { Aa,b(3); a.print(); b.print(); cout <<end1; }A.11B.13C.23D.33

考题 有以下程序 int a=2; int f(int n) { static int a=3; int t=0; if(n%2) {static int a=4; t+=a++;} else {static int a=5; t+=a++;} return t+a++; } main ( ) { int s=a, i; for (i=0;i<3; i++) s+=f (i) print f ("%d\n" , s ); } 程序运行后的输出结果是A.26B.28C.29D.24

考题 下面程序的运行结果为( )。 #includeiostream.h class A static int n; public: A{n=1;} A(int num){n=hum;} void print{coutn;} }: int A::n=2; void main { A a,b(3); a.print; b.print; coutendl:A.11B.13C.23D.33

考题 单击命令按钮时,下列程序代码的执行结果为 Private Sub Command1_Click( ) Print MyFunc(24,18) End Sub Public Function MyFunc(m As Integer,n As Integer)As Integer Do While m ◇ n Do While mn:m=m—n:Loop DO While m<n:n=n-m:Loop Loop My Func=m End FunctionA.2B.4C.6D.8

考题 下面程序输出的结果是()。includemain(){char *a="1234";fun(a);printf("\n");}fun(cha 下面程序输出的结果是( )。 #include<stdio.h> main() { char *a="1234"; fun(a); printf("\n"); } fun(char *s) { char t; if(*s) { t=*S++;fun(s);} else return; if(t!='\0') putchar(t); }A.1234B.4321C.1324D.4231

考题 下面程序的运行结果是______。 include include fun(char*w,int n) { char 下面程序的运行结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) {t=*s1++;*s1=*s2--;*s2=t;} } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.7654321B.1714171C.1711717D.7177171

考题 下面程序运行后,单击命令按钮,输出的结果是______。Private Sub Command1_Click()Dim a%(1 To 5),i%,sFor i=1 To 5a(i) =iNexts=Fun(A)Print "s=";s;End SubFunction Fun(a() As Integer)Dim t,i%t=1For i=LBound(A)To UBound(A)t=t*a(i)NextFun=tEnd Function

考题 下面程序段的输出结果是【 】。p = 0s = 0Dop = p + 2s = s + pLoop While p<11Print “s=”; s

考题 下面程序的输出结果是#includeclass example{int a:public:example(intB.{a=n++;}void print(){a=a+1;cout a ” ”;}void print()const{cout;}}void main(){example x t(3);const example y(2);x.print();y.print();}A.2 2B.4 3C.4 2D.3 2

考题 以下是表单的Activate事件的代码: s=0 n=0 do while n10 s=s+n   n=n+3 enddo this.label1.caption=str(s,2) 这段代码执行后,标签Label1的标题为()A、18B、10C、3D、0