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

题目内容 (请给出正确答案)
已知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';

else

switch(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;

}

画出程序中所有函数的控制流程图。


参考答案

更多 “ 已知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;}画出程序中所有函数的控制流程图。 ” 相关考题
考题 下面程序的运行结果是()。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 "string.h"#include "stdio.h"sort(char *a[],int n){ int i,j;char *p;for(j=1;j=n-1;j++)for(i=0; 【15】 ;i++)if( 【16】 0){ p=a[i];a[i]=a[i+1];a[i+1]=p;}}main(){ int i;char *book[]={"itisme","itisyou","howareyou","fine","goodnight","goodbye"};sort( 【17】 );for(i=0;i6;i++)printf("%s\n",book[i]);}

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

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

考题 有以下程序:includeinclude"string.h"void 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[]={"bee","bbcc","xy","aaaacc","aabcc"}; fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc

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