填空题
下面程序由两个源程序文件:t4.h和t4.c组成,程序编译运行结果是______。t4.h的源程序为:
#define N 10
#define f2(x)(x*N)
t4.c的源程序为:
#include<stdio.h>
#define M 8
#define f(x)((x)*M)
#include"t4.h"
main()
{int i,j;
i=f(1+1);j=f2(1+1);
printf("%d%d\n",i,j);
}
【参考答案】
16 11
热门
试题
单项选择题
有以下程序: #include<string.h> void f(char p[][10],int n) {char t[10];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() {char p[5][10]={ abc , aabdfg , abbd , dedbe , cd }; f(p,5); printf( %d n ,strlen(p[0]));} 程序运行后的输出结果是______。
A.2
B.4
C.6
D.3