编写函数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");}
以下程序的输出结果是________。main(){ char s[]={"12134211"}; int v[4]={0,0,0,0},k,i;for(k=0;s[k];k++){ switch(s[k]){ case '1':i=0;break;case '2':i=1;break;case '3':i=2;break;case '4':i=3;}v[i]++;}for(k=0;k<4;k++) printf("%d ",v[k]);}