以下程序用以删除字符串中所有的空格,请填空。inculde stdio.hmain(){ char s[100]=(“our teacher teach c language!”);int I,j;For(i=j=0;s[i]!=’’)iF(s[i];s[i]!=’\0’) {s[j]=s[i];j ++}s[j]=【 】printF(“index=%d\n”,s-a);}
以下程序用以删除字符串中所有的空格,请填空。
inculde <stdio.h>
main()
{ char s[100]=(“our teacher teach c language!”);int I,j;
For(i=j=0;s[i]!=’’)
iF(s[i];s[i]!=’\0’) {s[j]=s[i];j ++}
s[j]=【 】
printF(“index=%d\n”,s-a);
}
相关考题:
有以下程序:includeincludevoid fun(char s[][10],int n){char t;int i,j; 有以下程序: #include<stdio.h> #include<string.h> void fun(char s[][10],int n) { char t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) /*比较字符串的首字符大小,并交换字符串的首字符*/ if(s[i][0]>s[j][0]){t=s[i][0];s[i][0]=s[j][0];sEj][0]=t;} } main() {char s[5][10]={"bcc","bbcc","xy","aaaacc","aabcc"); fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.xcc,aabccD.acc,xabcc
下面程序的运行结果是()。includevoid del(char*s){int i,j;char *a;a=s;for(i=0,j=0;a 下面程序的运行结果是( )。 #include<stdio.h> void del(char*s) { int i,j; char *a; a=s; for(i=0,j=0;a[i]!='\0';i++) { if(a[i]>='0'a[i]<='9') { s[j]=a[i]; j++; } s[j]='\0'; }} main() {char s[]="aa89gggh"; del(s); printf("\n%s",s); }A.aaB.89C.ggghD.aa89gggh
有下列程序: include include "string.h" void tim(char *s[],int n) 有下列程序: #include <stdio.h> #include "string.h" void tim(char *s[],int n) { char *t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i]=s[j];s[j]=t;} } main() { char *ss[]= {"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
下面程序的运行结果是includevoid delch(char*s){int i,j;char *a;a=S;for(i=0,j=0;a[ 下面程序的运行结果是 #include<stdio.h> void delch(char *s) { int i,j; char *a; a=S; for(i=0,j=0;a[i]!='\0';i++) if(a[i]>='0' aa[i]<='9') {s[j]=a[i]; j++;} s[j]='\0';} main() { char *item="a34bC"; delch(item); printf("\A.abcB.34C.a34D.a34bc
有以下程序#include stdio.h#include string.hvoid fun(char *s[],int n){ char *t; int i,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)if(strlen(s[i])strlen(s[j])) {t=s[i];s[i]:s[j];s[j]=t;}}main(){ char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"};fun(ss,5); printf("%s,%s\n",ss[0],ss[4]);}程序的运行结果是A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
现在有如下程序#include "stdio.h"main(){char s[80];int i,j;gets(s);for(i=j=0;s[i]!=′\0′;i++)if(s[i]!=′H′______)s[j]=′\0′;puts(s);}这个程序段的功能是删除输入的字符串中字符′H′,则空线上应当添入的是A.s[j++]=s[i];j++;B.s[j]=s[i++];j++;C.s[j++]=s[i];D.s[j]=s[i];
以下程序用以删除字符串中所有的空格,请填空。 include main() {char s[100]={"Our teac 以下程序用以删除字符串中所有的空格,请填空。include<stdio.h>main(){char s[100]={"Our teacher teach C language!"};int i,j;for(i=j=0;s[i]!='\0';i++)if(s[i]!=''){( )}s[j]='\0';printf("%s\n",s);}
下列程序的输出结果是______。main(){ char ch[2][5]={"6937","8254"},*p[2]; int i,j,s=0; for(i=0;i<2;i++) p[i]=ch[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>'\0';j+=2) s=10*s+p[i][j]-'0'; printf("%d\n",s);}A.69825B.63825C.6385D.693825
下列程序的输出结果是( ) main() { char ch [2][5]={"6934","8254"},*p[2]; int i,j,s=0; for(i=0;i<2;i++) p[i]=ch[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>'\0'p[i][j]<='9';j+=2) s=10*s+p[i][j]-'0'; printf("%d\n",s); }A.6385B.69825C.63825D.693825
已知C源程序如下: include include void reverse(char S[]){ int C,i,J; f 已知C源程序如下:include<stdio. h>include<string. h>void reverse(char S[]){int C,i,J;for(i=0,j=strlen(s)-1;i<j;i++,j++){c=s[i];s[i]=s[j];s[j]=c;}}void getHex(int number,char s[]){int I;i=0;while(number>0){if(number%16<10)s[i++]=number%16+'0';elseswitch(number%16){case 10:s[i++]='A';break;case 11:s[i++]='B';break;case 12:s[i++]='C';break;case 13:s[i++]='D';break;case 14:s[i++]='E';break;case 15:s[i++]='F';break;default:printf("Error");break;}number/=16;}s[i]:'\o';reverse(s);}int main(){unsigned int number;int i=0:char s[50];printf("%s","please input number;\n");scanf("%d",&number):getHex(number,s);i=0;while(s[i])printf("%c",s[i++]);return 0;}画出程序中所有函数的控制流程图。
有以下程序 include include void fun(char s[][10],int n 有以下程序 #include <stdio.h> #include <string.h> void fun(char s[][10],int n) { char t; int i j; for (i=0; i<n-1; i++) for 0--i+l; j<n; j++) /*比较字符串的首字符大小,并交换字符串的首字符*/ if(s[i][0] > s[j][0]) { t = s[i][0]; s[i][0] = s[j][0]; s[j][0] = t;} } main() { char ss[5][10]= {"bcc", "bbcc", "xy", "aaaacc", "aabcc" }; fun(ss, 5); printf("%s,%s\n", ss[0],ss[4]); } 程序的运行结果是A.xy, aaaaccB.aaaacc,xyC.xcc,aabccD.acc,xabcc
以下程序运行后,输出结果是 ( ) main( ) {char ch[2][5]={"693","825"},*p[2]; int i,j,s=0; for(i=0;i<2;i+ +)p[i]=ch[i]; for(j=0;j<2;j+ +) for(j=0;p[i][j]>='0' p[i][j]<='9';j+=2) s=10 * s+p[i][j]-'0'; printf("%d\n",s); }A.6385B.22C.33D.693825
以下程序的输出结果是______。 main() { char ch[2][5]={"6937","8254"},*p[2]; int i,j,s=0; for(i=0;i<2;i++)p[i]=ch[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>'\0';j+=2) s=10*s+p[i][j]-'\0'; printf("%d\n",s); }A.69825B.59713C.6385D.693825
有以下程序:includeincludevoid fun(char*s[],int n){char*t;int i,j;for( 有以下程序: #include<stdio.h> #include<string.h> void fun(char*s[],int n) { char*t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])){t=s[i];s[i]=s[j];s[j]=t;} } main() { Char*ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
有如下程序 main() { char ch[2][5]={"6937","8254"},*p[2]; int i,j,s=0; for(i=0;i<2;++)p[i]=ch[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>'\0';j+=2) s=10*s+p[i][j]-'0'; printf("%d\n",s);} 该程序的输出结果是A.69825B.63825C.6385D.693825
有以下程序includeincludevoidfun(char*s[],intn){char*t;int i,j;for(i=0 有以下程序 #include <stdio.h> #include <string.h> void fun(char *s[],int n) { char *t; int i,j; for(i=0;i<n-1;++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i];s[j];s[j]=t;} } main() { char *ss[]={"bccA.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
下面程序的运行结果是( )。 #ineludestdio.h void del(char*s) { int i,j; char*a; a=s: for(i=0,j=0;a[i]!=\0;i++) { if(a[i]=0&&a[i]=9) {s[j]=a[i]; j++; } s[j]=\0; } } main { char*s="aa89gggh"; del(s): printf("\n%s",s); }A.1B.2C.3D.4
下列给定程序中,函数fun()的功能是:依次取出字符串中所有的字母,形成新的字符串,并取代原字符串。请改正程序中的错误,使它能得到正确结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。试题程序:include<stdio.h>include<conio.h>void fun(char*S){int i,j;for(i=0,j=0;s[i]! ='\0';i++)/*************found************/if((s[i]>='A's[i]<='Z')(s[i]>= 'a'S[i]<='z',))s[j++]=s[i];/*************found*************/s[j]=“\0”;}main(){char item[80];clrscr();printf(“\nEnter a string:”);gets(item);printf(“\n\nThe string is:\%S\n",item);fun (item);printf("\n\nThe string of changingis:\%S\n",item);}
以下程序运行后,输出结果是______。 main() {char ch[2][5]={"693","825"},*p[2]; int i,j,s=0; for(i=0;i<2;i++)p[i]=ch[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>='0'p[i][j]<='9';j+=2) s=10*s+p[i][j]-'0'; printf("%d\n",s); }A.6385B.22C.33D.693825
下面程序的运行结果是#includestdio.hvoid delch(char *s){ int i,j;char *a;a=s;for(i=0,j=0;a[i]!=′\n′;i++)if(a[i]=′0′ a[i]=′9′){s[j]=a[i]; j++;}s[j]=′\0′;}main(){ char *item="a34bc";delch(item);printf("\n%s",item);}A.abcB.34C.a34D.a34bc
有以下程序includeincludevoidfun(char,*s[],intn){char*t;inti,j; for(i= 有以下程序 #include <stdio.h> #include <string.h> void fun(char,*s[],int n) { char *t; int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i]:s[j];s[j]=t;} } main() { char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5); printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
下面程序的运行结果是()。includevoid delch(char *s){ int i,j;char*a;a=s;for(i=0,j= 下面程序的运行结果是( )。 #include<stdio.h> void delch(char *s) { int i,j; char*a; a=s; for(i=0,j=0;a[i]!='\0' ;i++) if(a[i]>='0' a[i]<='9') { s[j]=a[i]; j++;} s[j]='\0'; } main() { char*item="a34bc"; delch(item); printf("\n%s" ,item);}A.abcB.34C.a34D.a34bc
若输入 "I am a boy!",下列程序的运行结果为______。 char connect(string1,string2,string) char string1[],string2[],string[]; { int i,j; for (i=0;stringl[i] !='\0';i++) string[i]=stringl[i]; for (j=0;string2[j] !='\0';j++) string[i+j]=string2[j]; string[i+j ] ='\0'; } main ( ) { char s1 [100] , s2 [100] , s [100]; printf ("\n 输入 string1: \n"); scanf("%s",s1); printf (" \n 输入 string2: \n" ); scanf ("%s", s2); connect (s1, s2, s); printf ("%s\n", s); }A.I am a boy!B.输入string2:C.I amD.I am a boy!
( 14 )以下程序用以删除字符串所有的空格,请填空。#include stdio.hmain (){ char s[100]={ " Our teacher teach C language! " };int i,j;for ( i=j=0;s[i]!= ’ \0 ’ ;i++ )if ( s[i]!= ‘ ’ ) {s[j]=s[i];j++;}s[j]= 【 14 】printf ( " %s\n " ,s ) ;}
有以下程序#include stdio.h#include string.hvoid fun(char s[][10],int n){char t; int i,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)/*比较字符串的首字符大小 ,并交换字符串的首字符*/if(s[i][0]s[j][0]) {t=s[i][0];s[i][0]=s[j][0];s[j][0]=t;}}main(){char ss[5][10]={“bcc”,”bbcc”,”xy”,”aaaacc”,”aabcc”};fun(ss,5); printf(“%s,%s\n”,ss[0],ss[4]);}程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.xcc,aabccD.acc,xabcc
main( ){ int a[6]={10,20,30,40,50,60},i;invert(a,0,5);for(i=0;i6;i++) printf(“%d,”,a[i]);printf(“\n”);}invert(int s[ ],int i,int j){ int t;if(iJ){ invert(s,i+1j-1);t=s[i];s[i]=s[j];s[j]=t;}}
单选题有以下程序:#include #include void fun(char *s[],int n){ char *t; int i,j; for(i=0;i for(j=i+1;j if(strlen(s[i])strlen(s[j])) { t=s[i]; s[i]=s[j]; s[j]=t; }}main(){ char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5); printf("%s,%s",ss[0],ss[4]);}程序的运行结果是( )。Axy,aaaaccBaaaacc,xyCbcc,aabccDaabcc,bcc