填空题

阅读下列程序,则程序的输出结果为______。
#include"stdio.h"
struct ty
int data;
char c;;
main()
struct ty a=30,’x’;
fun(a);
printf("%d%c",a.data,a.c);
fun(struct ty b)
b.data=20;
b.c=’y’;

【参考答案】

30x
<上一题 目录 下一题>
热门 试题

填空题
mystrlen函数的功能是计算str所指字符串的长度,并作为函数值返回。请填空。 int mystrlen(char*str) int i for(i=0;______!=’ 0’;i++); return(i);
填空题
以下程序中函数f的功能是在数组x的n个数(假定n个数互不相同)中找出最大最小数,将其中最小的数与第一个数对换,把最大的数与最后一个数对换。请填空。 #include <stdio.h> voidf(int x[],int n) int p0,p1,i,j,t,m; i=j=x[0]; p0=p1=0; for(m=0;m<n;m++) if(x[m]>i i=x[m];p0=m; else if(x[m]<j j=x[m];p1:m; t=x[p0];x[p0]=x[n-1];x[n-1)=t t=x[p1];x[p1]= [12] ; [13] =t; main() int a[10],u; for(u=0;u<10;u++) scanf( %d ,&a[u]); f(a,10); for(u=0;u<10;u++) printf( %d ,a[u]); printf( n );
相关试题
  • 有以下程序 #include <stdio.h> mai...
  • 有以下函数 int aaa(char *s) char...
  • 有以下程序 #include <stdio.h> int...
  • 以下程序中函数f的功能是在数组x的n个数(...
  • 软件生命周期中花费费用最多的阶段是