题目内容 (请给出正确答案)
[主观题]

请写出下列程序的输出结果。()#includeint main() /{char str[ ]="1A2B3C4D"; int i;

请写出下列程序的输出结果。()

#include

int main() /{

char str[ ]="1A2B3C4D"; int i;

for(i=0;str[i]!='/0';i++)

if ((str[i]<'0') || (str[i]>'9'))

printf("%c",str[i]);

return 0;

/}

}

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“请写出下列程序的输出结果。()#includeint mai…”相关的问题

第1题

请写出下列程序的输出结果。()

#include

int main() /{

char str[ ]="1A2B3C4D"; int i;

for(i=0;str[i]!='/0';i++)

if ((str[i]<'0') || (str[i]>'9'))

printf("%c",str[i]);

return 0;

/}

}

点击查看答案

第2题

下列程序的输出结果是 #include void main( ) { char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) { case'1':x4++; case'2':x3++; case'3':x2++; case'4':x1++; } cout < < x1 < < "," < < x2

A.8,6,4,1

B.8,6,3,2

C.8,8,4,1

D.8,6,4,2

点击查看答案

第3题

下列程序的输出结果是 #include<iostream.h> void main() {char*str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) {case'1':x4++; case'2':X3++; case'3':X2++; case'4':X1++; } cout<<X1<<","<

A.8,6,4,1

B.8,6,3,2

C.8,8,4,1

D.8,6,4,2

点击查看答案

第4题

下列程序的输出结果是( )。 #include<iostream.h> void main() {char*str=”12123434”; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=’\0’;i++) switch(str[i]) {case’1’:x4++; case’2’:x3++; case’3’:x2++; case’4’:xl++; ) cout<<xl<<“,”<<x2<<

A.8,6,4,1

B.8,6,3,2

C.8,8,4,l

D.8,6,4,2

点击查看答案

第5题

有如下程序:

include <iostream>

using namespace std;

int strle(char a[],char b[])

{

int num=O,n=O;

while (* (a+num) !='\0')

num++;

while (b [n] )

{

* (a+num)=b [n];

num++;

n++;

}

return(num);

}

int main ()

{

char strl[80],str2[80],*p1=str1,*p2=str2;

cin>>p1;

cin>>p2;

cout<<strle(p1,p2)<<end1;

return 0;

}

运行上述程序,如果从键盘输入字符串qwerty和字符串abcd,则程序的输出结果是【 】。

点击查看答案

第6题

1. 阅读程序,程序输出结果 (1) 。#includemain( ){

1.阅读程序,程序输出结果   (1)   

#include<stdio.h>

main( )

{

int x,y;

x=-50%3;

y=50%(-3)

 printf( "%d,%d\n" , x , y );

}

2.阅读程序,程序输出结果   (2)   

#include<stdio.h>

main( )

{

 char c='M',str;

 str=c+32;

 printf("%c\n",str);

}

3.阅读程序,程序输出结果   (3)   

#include<stdio.h>

main( )

{

 int a=10, b=14, y;

 if (a<b) y=a*b;

 else  y=a/b;

 printf ("y=%d\n",y);

}

4.阅读程序,程序输出结果   (4)   

#include<stdio.h>

main( )

{

inta[3][4]={10,12,23,4,5,6,17,18,19,1,2,3},i,j,m;

m=a[0][0];

 for(i=0;i<3;i++)

 {

  for(j=0;j<4;j++)

     if(a[i][j]>m)m=a[i][j];

 }

 printf("m=%d\n",m);

}

5.阅读程序,程序输出结果   (5)   

#include <stdio.h>

int fun(int n) 

{ int i,y=1;  

 for(i=1; i<=n; i++)y=y*i;

 return y;    

}

main( ) 

{

 int a=5,p;

 p=fun(a);

 printf("p=%d\n",p); 

}

点击查看答案

第7题

阅读程序: include<string.h> include<strdio.h> strle(char a[],char b[]) {int num=0,n=0; while(*(a+num)!=0)num+ +; while(b[n]) { * (a+num)=b[n];num+ +;n+ +;} return(num); } main() {char strl[81],str2[81],* p1=strl,*p2=str2; gets(p1);gets(p2); prinf("%d\n",strle(p1,p2)); } 运行上面的程序,如果从键盘上输入字符串qwerty和字符串abcd,则程序的输出结果是【 】。

点击查看答案

第8题

设有定义:Strings=“World”;,下列语句错误的是( )。

A、intm=s.indexOf(‘r’);

B、charc=s.charAt(0);

C、intn=s.length();

D、Stringstr=s.append(‘2’);

点击查看答案

第9题

有下列程序: fun(charP[][10]) {intn=0,i; for(i=0;i<7;i++) if(p[i][0]:=T)n++; retumn; } main( ) {charstr[][10]={Mon,Tue,Wed,Thu,Fri,Sat,Sun); printf(%d\n.fun(str)); } 程序执行后的输出结果是

A.1

B.3

C.0

D.2

点击查看答案

第10题

下列定义数组的语句中正确的是______。

A.#define size 10 char str1[size],str2[size+2];

B.char str[];

C.int num['10'];

D.int n=5; int a[n][n+2];

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信