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

题目内容 (请给出正确答案)
下列程序的输出结果是______。 includevoid main( ){ char a[]="abcdabcabfgacd"; in

下列程序的输出结果是______。

include<iostream.h>

void main( )

{

char a[]="abcdabcabfgacd";

int i1=0,i2=0,i=0;

while(a[i])

{

if(a[i]=="a")i1++;

if(a[i]=="b")i2++;

i++;

}

cout<<i1<<""<<i2<<endl;

}


参考答案

更多 “ 下列程序的输出结果是______。 includevoid main( ){ char a[]="abcdabcabfgacd"; in 下列程序的输出结果是______。include<iostream.h>void main( ){char a[]="abcdabcabfgacd";int i1=0,i2=0,i=0;while(a[i]){if(a[i]=="a")i1++;if(a[i]=="b")i2++;i++;}cout<<i1<<""<<i2<<endl;} ” 相关考题
考题 以下程序运行后的输出结果是【】。 include void main() { char a[]="abcdabcabfgacd"; 以下程序运行后的输出结果是【 】。include<iostream.h>void main(){char a[]="abcdabcabfgacd";int i 1=0,i2=0,i=0;while (a[i]){if (a[i]=='a')il++;if (a[i]=='b')i2++;i++;}cout<<il<<' '<<i2<<endl;}

考题 下列程序的执行结果是【 】。 include int a; int sum_a(void) { a=a+5; return a; } 下列程序的执行结果是【 】。include <iostream. h>int a;int sum_a(void){a=a+5;return a;}void main(void){a = a+sum_a();cout<<a<<endl;}

考题 以下程序的输出结果是【】。 includevoid main() {char *p= "12345678" , *r;long *q; 以下程序的输出结果是【 】。include<iostream. h>void main() {char *p= "12345678" , *r;long *q;q=(long *)p;q++;r= (char *) q:cout<<r;}

考题 以下程序的输出结果是()。includevoid func(char**m) {++m:cout 以下程序的输出结果是( )。 #include<iostream.h> void func(char**m) { ++m: cout<<*m<<endl; } void main() { static char*a[]={"MORNING","AFTERTOON","EVENING"}; char**n; n=a: func(n); }A.为空B.MORNINGC.AFTERTOOND.EVENING

考题 下列程序的运行结果是______。include class Base { public: void f(int x){cout 下列程序的运行结果是______。include<iostream.h>class Base{public:void f(int x){cout<<“Base:”<<x<<endl;});class Derived:public Base{public:void f(char*str){cout<<“Derived:”<<str<<endl;}};void main(void){Base*pd=ne

考题 以下程序的输出结果是【 】。includeincludechar*fun(char*0{ char *p--t;retur 以下程序的输出结果是【 】。include <stdio.h>include <string.h>char *fun(char *0{ char *p--t;return (p+strlen(t)/2);}main(){ char *str="abcdefgh";str=ftm(str);puts(str);}

考题 下列程序的输出结果是______。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;}

考题 下列程序的输出结果是()。includevoid main(){char*Str;str="testI";cout 下列程序的输出结果是( )。 #include<iostream.h> void main() { char*Str; str="testI"; cout<<str[5]; }A.test!B.testC.空字符D.异常

考题 以下程序的输出结果是【 】。includeincludechar*fun(char*t){ char *p=t;retur 以下程序的输出结果是【 】。include <stdio.h>include <string.h>char *fun(char *t){ char *p=t;return (p+strlen(t)/2);}main(){ char *str="abcdefgh";str=ftm(str);puts(str);}