$str = "My name is Jack, and what is your name?";echo substr_count ($str,“name”);程序的输出结果为()。A、1B、2C、3D、4
$str = "My name is Jack, and what is your name?";echo substr_count ($str,“name”);程序的输出结果为()。
- A、1
- B、2
- C、3
- D、4
相关考题:
( 27 )有如下程序:#include iostreamusing namespace std;class Toy{public:Toy(char* _n) { strcpy (name,_n); count++;}~Toy(){ count--; }char* GetName(){ return name; }static int getCount(){ return count; }private:char name[10];static int count;};int Toy::count=0;int mail(){Toy t1("Snoopy"),t2("Mickey"),t3("Barbie");coutt1.getCount()endl;return 0;}运行时的输出结果是A ) 1B ) 2C ) 3D )运行时出错
( 29 )有如下程序:#includeiostreamusing namespace std;class Name{char name[20];public:Name(){strcpy(name,""); cout'?';}Name(char *fname)){strcpy(name,fname); cout'?';}};int main(){Name names[3]={Name(" 张三 "),Name(" 李四 ")};Return 0;}运行此程序输出符号?的个数是A ) 0B ) 1C ) 2D ) 3
有以下程序:includeincludeusingnameSpacestd;classperson{ intage; Char*nam 有以下程序:include <iostream>include <string>using nameSpace std;class person{int age;Char * name;public:person ( int i, Char * str ){int j;j = strlen( str ) + 1;name = new char[ j ];strcpy( name, str );age = i;}~person(){delete name;cout<<"D";}void display(){cout<<name<<":"<<age;}};int main(){person demo( 30,"Smith" );demo.display();return 0;}则该程序的输出结果为:【 】。
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?
下面哪些句子可以表示"您贵姓?"() A、What's your last name?B、What's your family name?C、What's your name?D、What's your first name?
有如下程序:#includeiostreamusing flamespace std;class Name{char name[20];public:Name(){strcpy(name,“”); cout‘?’;}Name(char*fname){strcpy(name,fname); cout‘?’;}};int main(){Name names[3]={Name(”张三”),Name(”李四”)};return 0;}运行此程序输出符号?的个数是A.0B.1C.2D.3
若有以下说明,则能打印出“Yu”的语句是______。 struct samp { char name[10]; int number; }kk[3]={{"WarBin",1},{"LiYu",2},{"LuHui",3}}; struct samp*str[3]; str[0]=kk[0];str[1]=kk[1];str[2]=kk[2];A.printf("%s\n",str[1].name[2]);B.printf("%s\n",str[1]->name+2);C.printf("%s\n",str[2].name[2]);D.printf("%s\n",str[2]->name+2);
以下选项中,合法的是( )。A.char str3[]={d,e,b,u,g,\0};B.char str4;str4="hello world";C.char name[10];name="china";D.char strl[5]="pass",str2[6];str2=strl;
有以下程序: #include 〈iostream〉 #include 〈string〉 using namespace std; class visited { private: int number; char *name; public: static int glob; void set mes(char *a); }; void visited::set mes(char *a) { name=new char[strlen(A) +1]; strcpy(name,A) ; number=++glob; } int visited::glob-O; int main() { visited person[10]; int i; char str[8]; for(i=0;i5;i++) { cinstr; person[i] .set mes(str); } coutA.5B.4C.3D.2
有如下程序:includeusing namespace std;class Name{char name[20];public:Name( ){s 有如下程序: #include<iostream> using namespace std; class Name{ char name[20]; public: Name( ){strepy(name," ");tout<<'?';} Name(char*fname){strcpy(name,fname);cout<<'?';} }; int main( ){ Name name[3]={Name("张三"),Name("李四")}; return 0; } 运行此程序输出符号“?”的个数是A.0B.1C.2D.3
Personal Information1. What is your name? Your name, please? Please give me your name. May I have your name?
下列程序通过实现Runnable接口创建一个线程,选择正确的语句填入程序的横线处。 class MyRun implements Runnable { String str; MyRun(String s) { str = s; } public void run() System.out.println(str); } } public class ex40 { public static void main(String[] args) { String name = "实现阶段Runnable 接口"; MyRun my = new MyRun(name); Thread th = th. start ( ); } }A.new MyRun(my)B.new Thread()C.new Thread(my)D.Thread(my)
如果要把一个用户名jack保存在session对象里,则下列语句正确的是()。A、 session.setAttribute( name, jack );B、 session.setAttribute(“ name” , “jack”);C、 session.setAttribute( “jack”, “ name” );D、 session.setAttribute(“jack”, name );
单选题如果要把一个用户名jack保存在session对象里,则下列语句正确的是()。A session.setAttribute( name, jack );B session.setAttribute(“ name” , “jack”);C session.setAttribute( “jack”, “ name” );D session.setAttribute(“jack”, name );
单选题有如下程序:#include #include main(){ char name[10]=c-book; char *str=name; printf(%d,%d,%d,%d, sizeof(name), strlen(name), sizeof(str), strlen(str));}程序运行后的输出结果是( )。A10,6,4,6B11,6,11,6C11,6,1,6D10,7,1,7
单选题以下涉及字符串数组、字符指针的程序段,不会产生编译错误的是( )。Achar*str,name[10]; str=Hello World;Bchar*str,name[10]; name=Hello World;Cchar str1[10]=prog.c, str2[10]; str2=str1;Dchar head_line[]; head_line=== == == == == == =;
单选题有以下程序:#includemain(){ charname[10]={'S','T','R'}; name[2]='#'; name[6]=0; printf(%s,name);}程序运行后的输出结果是( )。AST#BSTR#CSTR#0DSTR0
单选题有如下程序:#include int disp(char *str){ while(*str) putchar(*str++); return *str;}main(){ printf(%d,disp(NAME));}程序运行后的输出结果是( )。ANAME0BNAMEECNAMEDNAME\0
单选题以下选项中,合法的是( )。Achar str3[]={'d', 'e', 'b', 'u', 'g', '\0'}Bchar str4; str4=hello world;Cchar name[10]; name=china;Dchar str1[5]=pass, str2[6]; str2=str1;
单选题$str = "My name is Jack, and what is your name?";echo substr_count ($str,“name”);程序的输出结果为()。A1B2C3D4
单选题有如下程序:#include main(){ char name[10] = {'S','T','R','I','N','G'}; name[3]='E'; name[5]=0; printf(%s,name);}程序运行后的输出结果是( )。ASTRENGBSTRIEGCSTRENDSTREN0
单选题程序 character*(*)name name=’apple’ L=len(name) Do10I=1,L 10name(I:I)=char(Ichar(name(I:I))+I print*,name end 程序运行后输出结果为( )AAPPLEBbrspjCjpsrbDapple