有以下程序:include using namespace std;int main ( ){ char s1[10],s2[10]; char*p 有以下程序: #include <iostream> using namespace std; int main ( ) { char s1[10],s2[10]; char *p=s1,*q=s2; cin>>s1>>s2; while (*p ! =' \0 ' ) p++; while (*q!='\0') *p++=*q++; *p='\0'; cout<<s1<<end1; return 0; }A.abcd0ghijB.abcd0ghij0C.abcdD.abcdghij
有以下程序:include using namespace std;int main ( ){ char s1[10],s2[10]; char*p
有以下程序: #include <iostream> using namespace std; int main ( ) { char s1[10],s2[10]; char *p=s1,*q=s2; cin>>s1>>s2; while (*p ! =' \0 ' ) p++; while (*q!='\0') *p++=*q++; *p='\0'; cout<<s1<<end1; return 0; }
A.abcd0ghij
B.abcd0ghij0
C.abcd
D.abcdghij
相关考题:
以下程序的输出结果是【】。 include using namespace std; int main() {char S[]="abcde 以下程序的输出结果是【 】。include <iostream>using namespace std;int main(){char S[ ]="abcdef";s[3]='\0';cout<<s<<end1;return 0;}
下列程序的输出结果是______。 include include using namespace std; voi 下列程序的输出结果是______。include<iostream.h>include<string.h>using namespace std;void fun(const char*s,char C) {c=s[strlen(s)/2];}int main(){char str[]="ABCDE";char ch=str[1];fun(str,ch);cout<<ch;return 0;}
若有以下程序段: include using namespace std; int main() {char*p="abcdefgh",*r;l 若有以下程序段:include <iostream>using namespace std;int main(){char*p="abcdefgh",*r;long*q;q=(long*)p;q++;r=(char*)q;cout<<r<<end1;return 0;}该程序的输出结果是【 】。
有以下程序: include using namespace std; constxntN=5; int fun(char*s,char a,int 有以下程序:include <iostream>using namespace std;const xnt N=5;int fun(char *s,char a,int n){int j;*s=a;j=n;while(a<s[j])j--;return j;}int main(){char s[N+1];int k;
下列程序的输出结果是()。includeusing namespace std;int main()于chara[]=”Hello,Te 下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() 于 chara[]=”Hello,Test”; Char*p=a; while(*p) { if(*p)=’a’*p(=’z’) cout<<char(*p+’A’-’a’); else cout<<*p; p++; } return 0; }A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST
有如下程序: include using namespace std; int main() { char st 有如下程序: #include <iostream> using namespace std; int main() { char str[100], *p; cout<<"Please input a string:"; cin>>str; p=str; for (int i=0; *p!='\0'; p++,i++); cout<<i<<endl; return 0; }运行这个程序时,若输入字符串为 abcdefgabcd则输出结果是A.7B.12C.13D.100
有以下程序: include using namespace std; int main() {int i=010,j=10;cout 有以下程序:include <iostream>using namespace std;int main(){int i=010,j=10;cout<<(++i)<<","<<i--<<end1;return 0;}则该程序运行后的输出结果是【 】。
下面程序运行输出的结果是【】。 include using namespace std; int main(){char a[]="C 下面程序运行输出的结果是【 】。include <iostream>using namespace std;int main(){char a[]="Chinese";a[3]='\0';cout<<a<<endl;return 0;}
有以下程序: include using namespace std; char *x[]={"First", "Second", "Third" 有以下程序: #include <iostream> using namespace std; char *x[]={"First", "Second", "Third" }; void f(char *z[ ]) { cout<<*z++<<end1; } int main ( ) { char **y; y=x; f(y); return 0; }A.产生语法错误B.FirstC.SecpndD.Third
有以下程序includeincludeusing namespace std;class base{private:charbas 有以下程序 #include<iostream> #include<string> using namespace std; class base { private: charbaseName[10]; public: base() { strcpy(baseName,"Base"); } virtual char*myName() return baseName; } char *className() { return baseName; } }; class Derived: public base { private: char derivedName[10]; public: Derived() { strcpy(derivedName,"Derived"); } char *myName() { return derivedName; } char *className() { return derivedName; } }; void showPtr(base p) { cout<<p.myName0<<" "<<p.className(); } int main() { base bb; Derived dd; showPtr(dD) ; retum 0; } 动行后的输出结果为A.Derived BaseB.Base BaseC.Derived DerivedD.Base Derived
下列程序的输出结果是( )。 include using namespace std; int main() { 下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]="Hello,Test"; char *p=a; while(*p) { if(*p>='a'*p<='z') cout<<char(*p+'A'-'a'); else cout<<*p; p++; } return 0; }A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST
有以下程序include include using namespace std;class base{private:char 有以下程序 #include <iostream> #include <string> using namespace std; class base { private: char baseName[10]; public: base () { strcpy(baseName,"Base"); } virtual char *myName() { return baseName; } char *className() { return baseName; } }; class Derived : public base { private: char derivedName[10]; public: Derived() { strcpy(derivedName,"Derived"); } char *myName() { return derivedName; } char *className() { return derivedName; } }; void showPtr(base p) { cout<<p.myName () <<" "<<p.className (); } int main () { base bb; Derived dd; showPtr(dd); return 0; } 运行后的输出结果为A.Derived BaseB.Base BaseC.Derived DerivedD.Base Derived
若有如下程序:include using namespace std;int main(){ char *p="abcdefgh",*r; lon 若有如下程序: #include <iostream> using namespace std; int main() { char *p="abcdefgh",*r; long *q; q=(long *)p; q++; r=(char *)q; cout<<r<<end1; return 0; } 上述程序的输出结果是( )。A.abcdefghB.0C.abcdD.efgh
若有如下程序段: include using namespace std; int main() {char*p="abcdefgh",*r;l 若有如下程序段:include <iostream>using namespace std;int main(){char *p="abcdefgh",*r;long *q;q=(long *)p;q++;r=(char *)q;cout<<r<<end1;return 0;}该程序的输出结果是______。
有以下程序,其输出结果是()。include using namespace std;int main(){ char a[10]={' 有以下程序,其输出结果是( )。 #include <iostream> using namespace std; int main(){ char a[10]={'1','2','3','4','5','6','7','8','9',0},*p; int i=8; p=a+i; cout<<p-3<<endl; return 0; }A.6789B.6C.789D.'6'
若有以下程序: include using namespace std; int main() {char str[10];cin>>str;co 若有以下程序:include <iostream>using namespace std;int main(){char str[10];cin>>str;cout<< str<<end1;return 0;}当输入为:This is a program!那么执行程序后的输出结果是【 】。
有以下程序: include include using namespace std; int main () {char ch[] 有以下程序:include <fstream>include <string>using namespace std;int main (){char ch[] = "The end";ofstream outstr( "d:\\put.txt", ios_base: :app);for (int i = 0; i < strlen( ch ); i++ )outstr.put(ch[i]);outstr.close();return 0;}程序实现的功能是【 】。
下列程序的输出结果是______。includeinclude using namespace std;void 下列程序的输出结果是______。include <iostream.h>include <cstring.h>using namespace std;void fun(const char*s,char C) {c=s[strlen (s)/2];}int main {){char str [] ="ABCDE";char ch=str[1];fun(str,sh);cout<<Ch;return 0;}
下列程序的输出结果是()。includeusing namespace std;int main(){char a[]="Hello,Te 下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]="Hello,Test"; char *p=a; while(*p) { if(*p>='a'*p<='’z') cout<<char(*p+'A'-'a'); else cout<<*p; p++; } return 0; }A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST
有以下程序:include include using namespace std;class base{private: cha 有以下程序: #include <iostream> #include <string> using namespace std; class base { private: char baseName[10]; public: base ( ) { strcpy (baseName, "Base"); } virtual char *myName() {A.DerivedBaseB.BaseBaseC.DerivedDerivedD.BaseDerived
有以下程序:include include using namespace std;int main ( ){ ofstream 有以下程序: #include <iostream> #include <fstream> using namespace std; int main ( ) { ofstream ofile; char ch; ofile.open ("abc.txt"); cin>>ch; while (ch!='#' ) { cin>>ch; ofile.put(ch);A.程序编译时出错B.abc#C.abcD.#
以下程序的执行结果为【】。 include using namespace std; void overload(int num) {cou 以下程序的执行结果为【 】。include<iostream>using namespace std;void overload(int num){cout<<num<<end1;}void overload(char ch){char c=ch+1;cout<<c<<end1;}int main(){overload('X');return 0;}
有以下程序: include include using namespace std; int main() {char arr[ 有以下程序: #include<iostream> #include<string> using namespace std; int main() { char arr[2][4]; strcpy(arr[0],"you"); strcpy(arr[1],"me"); arr[0][3]=''; cout<<arr[0]<<end1; return 0; } 执行后的输出结果是( )。A.youmeB.youC.meD.err
有以下程序:include include using namespace std;int main ( ){ char b1[8 有以下程序: #include <iostream> #include <string> using namespace std; int main ( ) { char b1[8] = "abcdefg"; char b2[8],*pb=b1+3; while (--pb>=b1) strcpy (b2, Pb) ; cout<<strlen (b2) <<end1; return 0; } 程序运行后的输出结果是( )。A.8B.3C.1D.7
有下列程序段:include using namespace std;int main() { char b[]= "Hello,you"; b[ 有下列程序段: #include <iostream> using namespace std; int main() { char b[] = "Hello,you"; b[5] = 0; cout<<b<<end1; return 0; } 执行此程序后,得到的输出结果是( )。A.Hello,youB.Hello0youC.HelloD.0
有以下程序:includeincludeusxng namespace std;int main(){ char p[] = "a 有以下程序: #include <iostream> #include <string> usxng namespace std; int main() { char p[] = "abcdefgh"; cout<<strlen(strcpy(p,"12345"))<<end1; return 0; } 执行后输出的结果是( )。A.8B.12C.5D.7
有以下程序: include using namespace std; int main() {char a[10] = {'1','2','3', 有以下程序: #include<iostream> using namespace std; int main() { char a[10] = {'1','2','3','4','5','6','7','8','9','0'),*p; int i=8; p=a+i; cout<<p-3<<end1; return 0; } 执行程序后的输出结果是( )。A.6B.6789C.'6'D.789