下面程序在运行输入:abcdefg (回车),则输出是:。#include main(){char str[100];printf("输入字符串:\n"); scanf("%s",str);inverse(str); printf("轮换后的字符串是:%s\n",str);}inverse(char str[]){char t;int i,j;for(i=0,j=strlen(str); i
查看答案
编写函数acopy( ),将数组a[]的内容赋值到b[]数组中。(以999做结束标志)#include void acopy(1){int i=0;while (a[i]!=-999){2i++;}b[i]= 3}main( ){ int a[]={1,2,3,4,5,6,7,8,9,10,999};int b[100], i=0;4while (b[i]!=-999) printf("%d",b[i++]);}
找出并显示以字母’C’开头的姓名数据。#include main( ){char name[][8]={"China","Japan","Canada","Germany"};int i;for (i=0;i<4;i++)if ( ) printf("%s\n",name[i]);}
输入一字符串,将字符串从最后一个开始,按倒序显示在屏幕上。#include main( ){char a[10];int i;printf("Please imput yuor string:\n");for (①)scanf("%c",&a[i]);for (②)printf("%c",a[i]);}
下面程序的运行以后的结果是________。main(){ char a[]="clanguage",t;int i,j,k;k=strlen(a);for(i=0;i<=k-1;j+=1)for(j=i+1;ja[j]){t=a[i];a[i]=a[j];a[j]=t;}puts(a);printf("\n");}