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

题目内容 (请给出正确答案)
在下面程序运行includeint func(char s[]){ int length=0; while(*(s+length))leng

在下面程序运行 #include<iostream.h> int func(char s[]){ int length=0; while(*(s+length))length++; return length; } void main(){ char a[10], *ptr=a; cin>>ptr; cout<<fune(ptr)<<end1; } 如果输入字符串Hello!并回车,则输出结果为 ______。

A.4

B.7

C.6

D.5


参考答案

更多 “ 在下面程序运行includeint func(char s[]){ int length=0; while(*(s+length))leng 在下面程序运行 #include<iostream.h> int func(char s[]){ int length=0; while(*(s+length))length++; return length; } void main(){ char a[10], *ptr=a; cin>>ptr; cout<<fune(ptr)<<end1; } 如果输入字符串Hello!并回车,则输出结果为 ______。A.4B.7C.6D.5 ” 相关考题
考题 有以下程序include stdio.hint fun(char s[]){ int n=0;while(*s='9'stdio.hint fun(char s[]){ int n=0;while(*s='9'*s='0') {n=10*n+*s-'0';s++;}return(n);}main(){ char s[10]={ '6', '1', '*', '4', '*', '9', '*', '0', '*'};printf("%d\n",fun(s));}程序运行的结果是A ) 9B ) 61490C ) 61D ) 5

考题 以下程序的执行结果是______ includevoid func(int); void main(){ int k=4 func(k) 以下程序的执行结果是______include<iostream.h>void func(int);void main(){int k=4func(k) ;func(k) :cout<<end1;}void func(int a){static int m=0;m+=a;cout<<m<<" ";}

考题 下列程序的输出结果为 include int func(int n) {if(n 下列程序的输出结果为#include<iostream.h>int func(int n){if(n<1) return 1;else retur n+func(n-1) ;return 0;}void main( ){cout < < func(5) < < endl;}A.0B.10C.15D.16

考题 以下程序运行后的输出结果是【】。 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 void main( ) { int i=1; while(i 下面程序的运行结果是#include<iostream.h>void main( ){int i=1;while(i <=8)if(++i%3!=2) continue;else cout < < i;}A.25B.36C.258D.369

考题 有以下程序: 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;

考题 下面程序运行时输出结果为______。 include include class Rect { public: Rect(int 下面程序运行时输出结果为______。include<iostream.h>includeclass Rect{public:Rect(int l, int w){length=l; width=w;)void Print(){cout<<"Area:"<<length*width<<end1;}void operator delete(void*p){free(p);}private:int length, width;};void main(){Rect *p;p=new Rect(5, 4);p->Print();delete p;}

考题 下面程序的输出结果为【】。 include main() { char a[]="morning",t; int i,j=0; for( 下面程序的输出结果为【 】。include<iostream.h>main(){char a[]="morning",t;int i,j=0;for(i=1;i<7;i++)if(a[j]<a[i])j=i;t=a[j];a[j]=a[7];a[7]=a[j];cout<<a;}

考题 阅读下面程序: include int fun2(int m) { if(m%3==0) return 1; else return 0; } 阅读下面程序:include <iostream.h>int fun2(int m){if(m%3==0)return 1;elsereturn 0;}void fun1(int m, int s){int i;for (i=1; i<m; i++)if(fun2(i))S=S*i;}void main(){int n=9, s=2;fun1(n, s);cout<<s<<end1;}该程序的运行结果是【 】。

考题 下面程序运行输出的结果是【】。 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 define SlZE 12 main() {char s[SIZE];int i;for(i=0 下面程序的运行结果是( )。include<stdio.h>define SlZE 12main(){char s[SIZE];int i;for(i=0;i<SIZE;i++) s[i]='A'+i+32;sub(s,5,SIZE-1);for(i=0;i<SIZE;i++)printf("%c",s[i]);printf("\n");}sub(char *a,int t1,int t2){ char ch;while(t1<t2){ ch=*(a+t1);*(a+t1)=*(a+t2);*(a+t2)=ch;t1++;t2--;}}

考题 下面程序的运行结果是includemain(){int a=28,b;char s[10],*p;p=s;do{b=a%16;if(b 下面程序的运行结果是 #include<stdio.h> main() {int a=28,b; char s[10],*p; p=s; do{b=a%16; if(b<10) *p=b+48; else*p=b+55; p++;a=a/5;}while(a>0); *p='\0';puts(s);}A.10B.C2C.C51D.\0

考题 有以下程序 include int fun(char s[]) { int n=O; whil 有以下程序 #include <stdio.h> int fun(char s[]) { int n=O; while(*s<='9'*s>='0') { n=10*n+*s-'0'; s++; } return (n); } main() { char s[10]={ '6', '1', '*', '4', '*', '9', '*', '0', '*'}; printf("%d\n",fun(s)); }A.9B.61490C.61D.5

考题 下面程序的运行结果为_____。 include void fun(int x=0,int y=0) { cout 下面程序的运行结果为_____。include<iostream.h>void fun(int x=0,int y=0){cout < < x < < y;}void main( ){fun(5) ;}

考题 下面程序的运行结果是( )。 include main() {char a[80],*p="AbabCDcd"; int i=0,j=0; w 下面程序的运行结果是( )。 include<stdio.h> main() {char a[80],*p="AbabCDcd"; int i=0,j=0; while(*(p++)!='\0') {if(*p>='a'*p<='z'){a[i]=*p;i++;} } a[i]='\0'; puts(A); }

考题 程序的结果为______。include"iostream.h" template T total(T*data) { Ts=0; while( 程序的结果为______。include"iostream.h"template<typename T>T total(T*data){Ts=0;while(*data){S+=*data++;}return S;}int main(){int x[]={2,4,6,8,0,12,14,16,18};cout<<total(x);retum 0;cout<<endl;}

考题 有以下程序includeintfun(chars[]){intn=0;while(*s='0'){n=10*n+* 有以下程序 #include <stdio.h> int fun(char s[]) { int n=0; while(*s<='9'*s>='0') {n=10*n+*s-'0';s++;} return(n); } main() {char s[10]={'6','1','*','4','*','9','*','0','*'}; printf("%d\n",fun(s)); } 程序的运行结果是A.9B.61490C.61D.5

考题 下面程序的运行结果为【】。 include void main() {unsigned char value=127;int tota 下面程序的运行结果为【 】。include <iostream.h>void main(){unsigned char value=127;int total=100;value++;total+=value;cout<<total<<end1;}A) 227 B) 100 C) 127 D) 27

考题 下面程序的运行结果是 ______。 include void main() { char str[]="SSSWLIA",c; int 下面程序的运行结果是 ______。include<iostream.h>void main(){char str[]="SSSWLIA",c;int k;for(k=2;(c=str[k]!='\0';k++){switch(c){case'I':++k;break;case'l';continue;default;c

考题 下面程序的运行结果是( )。 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); }

考题 下面程序的运行结果为 include void main( ) { for(int a =0,x=0;!xa 下面程序的运行结果为#include<iostream.h>void main( ){for(int a =0,x=0;!xa<=10;a++){a++;}cout < < a < < endl;}A.10B.11C.12D.0

考题 以下程序的输出结果是()。includeint fun (char*s){char *p=s;while (*p!='\0,) p++ 以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }A.3B.6C.8D.0

考题 有以下程序 include int fun(char s[ ]) { int n=0; while(*s='0 有以下程序#include <stdio.h>int fun(char s[ ]){ int n=0;while(*s<='9'*s>='0') {n=10*n+*s-'0';s++;}retum(n);}main( ){ char s[10]={'6','1','*','4','*','9','*','0','*'};printf("%d\n",fun(s));}程序的运行结果是A.9B.61490C.61D.5

考题 有以下程序:includeint fun(char s[]){ intn=0;while(*s='0'){n=10 有以下程序: #include <stdio.h> int fun(char s[]) { int n=0; while(*s<='9'*s>='0') {n=10*n+*s-'0';s++;} return(n); } main() { char s[10]={'6','1','*','4','*','9','*','0','*'}; printf("%d\n",fun(s)); } 程序的运行结果是( )。A.9B.61490C.61D.5

考题 下面程序的运行结果是______。 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

考题 下列程序的运行结果是______。include int Func(int *a,int n) {int s=1; for(int i=0 下列程序的运行结果是______。include<iomanip.h>int Func(int *a,int n){int s=1;for(int i=0;i<n;i++)s*=*a++;returns;}void main(){inta[]:{1,2,3,4,5,6,7,8};intb=Func(a,6)+Func(a[5],2);cout<<“b=“<(b<<endl;}

考题 单选题有以下程序#include int fun(char s[]){ int n=0; while(*s='0') {  n=10*n+*s-'0';  s++; } return (n);}main(){ char s[10]={'6','1','*','4','*','9','*','0','*'}; printf("%d",fun(s));}程序的运行结果是(  )。A 61490B 61C 9D 5