当int x=2,y=4,z=3时,执行以下程序段后z= 徐师大c语言期末考试11机

\u5f53int x=2,y=4,z=3\u65f6,\u6267\u884c\u4ee5\u4e0b\u7a0b\u5e8f\u6bb5\u540ez=_____. if(x<y)z+=x; else z+=y;

z\u6700\u540e\u503c\u662f1\u3002
\u89e3\uff1a\u6bcf\u4e2aif\u5224\u65ad\u6761\u4ef6\uff0c\u53ea\u63a7\u5236\u5176\u540e\u7684\u4e00\u4e2a\u53e5\u5b50\uff0c\u4e5f\u5c31\u662fif\u4e4b\u540e\uff0c\u7b2c\u4e00\u4e2a\u5206\u53f7\u4e4b\u524d\uff0c\u5f53\u7136\uff0c\u4f60\u53ef\u4ee5\u7528\u5927\u62ec\u53f7\u628a\u82e5\u5e72\u53e5\u5b50\u62ec\u5230\u4e00\u8d77\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u53e5\u5b50\uff0c\u4ee5\u4f7fif\u4e4b\u540e\u6267\u884c\u591a\u4e2a\u53e5\u5b50\u3002
\u6240\u4ee5\uff0cx \u7136\u540e\u7ee7\u7eed\u7a0b\u5e8f\uff0c\u6267\u884cx=y\uff0c\u6b64\u65f6\uff0cx=2\uff0cy=2\uff0cz=1
\u6700\u540e\uff0c\u6267\u884cy=z\uff0c\u6b64\u65f6\uff0cx=2\uff0cz=1;
\u56e0\u4e3ax=1\uff0cz=x=1\uff1b
x=y=2\uff1b
y=z=x=1\uff1b

\u6269\u5c55\u8d44\u6599\uff1a
Int\u662f\u5c06\u4e00\u4e2a\u6570\u503c\u5411\u4e0b\u53d6\u6574\u4e3a\u6700\u63a5\u8fd1\u7684\u6574\u6570\u7684\u51fd\u6570\u3002INT\u662f\u6570\u636e\u5e93\u4e2d\u5e38\u7528\u51fd\u6570\u4e2d\u7684\u53d6\u6574\u51fd\u6570\uff0c\u5e38\u7528\u6765\u5224\u522b\u4e00\u4e2a\u6570\u80fd\u5426\u88ab\u53e6\u4e00\u4e2a\u6570\u6574\u9664\u3002\u5728\u7f16\u7a0b\u8bed\u8a00\uff08C\u3001C++\u3001C#\u3001Java\u7b49\uff09\u4e2d\uff0c\u5e38\u7528\u4e8e\u5b9a\u4e49\u6574\u6570\u7c7b\u578b\u53d8\u91cf\u7684\u6807\u8bc6\u7b26\u3002
\u5728\u4e00\u822c\u7684\u7535\u8111\u4e2d\uff0cint\u5360\u75284\u5b57\u8282\uff0c32\u6bd4\u7279\uff0c\u6570\u636e\u8303\u56f4\u4e3a-2147483648~2147483647[-2^31~2^31-1]\uff1b
\u5728\u4e4b\u524d\u7684\u5fae\u578b\u673a\u4e2d\uff0cint\u5360\u75282\u5b57\u8282\uff0c16\u6bd4\u7279\uff0c\u6570\u636e\u8303\u56f4\u4e3a-32768~32767[-2^15~2^15-1]\uff1b
\u4f7f\u7528printf\u8f93\u51faint\u5360\u7528\u5b57\u8282\u6570\u91cf\uff1a
printf("%d",sizeof(int))\uff1b
\u9664\u4e86int\u7c7b\u578b\u4e4b\u5916\uff0c\u8fd8\u6709short\u3001long\u3001long long\u7c7b\u578b\u53ef\u4ee5\u8868\u793a\u6574\u6570\u3002
unsigned int \u8868\u793a\u65e0\u7b26\u53f7\u6574\u6570\uff0c\u6570\u636e\u8303\u56f4\u4e3a[0~2^32-1]\u3002

1\u3001\u51fd\u6570fun\u7684\u529f\u80fd\u662f\u8ba1\u7b97x^n\u3002
double fun(double x,int n)
{int i; double y=1;
for(i=1;i<=n;i++) y=y*x;
return y;
}
\u4e3b\u51fd\u6570\u4e2d\u5df2\u7ecf\u6b63\u786e\u5b9a\u4e49m\u3001a\u3001b\u53d8\u91cf\u5e76\u8d4b\u503c\uff0c\u5e76\u8c03\u7528fun\u51fd\u6570\u8ba1\u7b97\uff1am=a^4+b^4-(a+b)^3\u3002\u5b9e\u73b0\u8fd9\u4e00\u8ba1\u7b97\u7684\u51fd\u6570\u8c03\u7528\u8bed\u53e5\u4e3a______\u3002


\u7b54\u6848\uff1a 1\uff1afun(a,4)+fun(b,4)-fun((a+b),3)
\u8bc4\u6790\uff1a
\u51fd\u6570fun\u7684\u529f\u80fd\u662f\u8ba1\u7b97x\u7684n\u6b21\u65b9\uff0c\u6240\u4ee5a\u76844\u6b21\u65b9\u7684\u8c03\u7528\u51fd\u6570\u5e94\u5f53\u4e3afun(a,4)\uff0cb\u76844\u6b21\u65b9\u7684\u8c03\u7528\u51fd\u6570\u5e94\u5f53\u4e3afun(b,4)\uff0c(a+b)\u76843\u6b21\u65b9\u7684\u8c03\u7528\u51fd\u6570\u5e94\u5f53\u4e3afun((a+b),3)\uff0c\u6240\u4ee5\uff0c\u5b9e\u73b0m=a^4+b^4-(a+b)^3\u8fd9\u4e00\u8ba1\u7b97\u7684\u51fd\u6570\u8c03\u7528\u8bed\u53e5\u4e3a\uff1afun(a,4)+fun(b,4)-fun((a+b),3);\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528


2\u3001\u4ee5\u4e0bsstrcpy()\u51fd\u6570\u5b9e\u73b0\u5b57\u7b26\u4e32\u590d\u5236\uff0c\u5373\u5c06t\u6240\u6307\u5b57\u7b26\u4e32\u590d\u5236\u5230s\u6240\u6307\u5185\u5b58\u7a7a\u95f4\u4e2d\uff0c\u5f62\u6210\u4e00\u4e2a\u65b0\u5b57\u7b26\u4e32s\u3002\u8bf7\u586b\u7a7a\u3002
void sstrcpy(char *s,char *t)
{ while(*s++=______);}
main()
{ char str1[100],str2[]="abcdefgh";
sstrcpy(str1,str2);
printf("%s\n",str1);
}


\u7b54\u6848\uff1a 1\uff1a*t++
\u8bc4\u6790\uff1a
\u8981\u4f7fsstrcpy()\u51fd\u6570\u5b9e\u73b0\u5b57\u7b26\u4e32\u590d\u5236\uff0c\u5fc5\u987b\u5c06t\u5b57\u7b26\u4e32\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26\u9010\u4e2a\u62f7\u5230s\u5b57\u7b26\u4e32\u4e2d\uff0c\u6240\u4ee5\u53ef\u4ee5\u4f7f\u7528*s=*t;s++;t++\u3002\u6216\u8005\u53ef\u4ee5\u5199\u6210*s++=*t++\uff0c\u672c\u9898\u53ea\u6709\u4e00\u4e2a\u7a7a\uff0c\u53ef\u4ee5\u586b\u5165*t++\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u6307\u9488/\u7528\u6307\u9488\u4f5c\u51fd\u6570\u53c2\u6570




3\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u7ed9\u6307\u9488p\u5206\u914d\u4e09\u4e2adouble\u578b\u52a8\u6001\u5185\u5b58\u5355\u5143\uff0c\u8bf7\u586b\u7a7a\u3002
#include
main()
{ double *p;
p=(double*)malloc(______);
p[0]=1.5; p[1]=2.5;p[2]=3.5;
printf("%f%f%f\n",p[0],p[1],p[2]);
}


\u7b54\u6848\uff1a 1\uff1a3*sizeof(double)
\u8bc4\u6790\uff1a
malloc(size)\u5728\u5185\u5b58\u7684\u52a8\u6001\u5b58\u50a8\u533a\u4e2d\u5206\u914d\u4e00\u4e2a\u957f\u5ea6\u4e3asize\u7684\u8fde\u7eed\u7a7a\u95f4\u3002\u6b64\u51fd\u6570\u7684\u503c\uff08\u5373"\u8fd4\u56de\u503c"\uff09\u662f\u4e00\u4e2a\u6307\u9488\uff0c\u5b83\u7684\u503c\u662f\u8be5\u5206\u914d\u57df\u7684\u8d77\u59cb\u5730\u5740\u3002\u5982\u679c\u6b64\u51fd\u6570\u672a\u80fd\u6210\u529f\u5730\u6267\u884c\uff0c\u5219\u8fd4\u56de\u503c\u4e3a0\u3002
\u672c\u9898\u4e2d\u8981\u6c42\u5206\u914d\u4e09\u4e2adouble\u578b\u52a8\u6001\u5185\u5b58\u5355\u5143\uff0c\u6240\u4ee5size\u5904\u5e94\u5f53\u4e3a3*sizeof(double)\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u6307\u9488/\u5404\u7c7b\u578b\u7684\u6307\u9488\u53ca\u6307\u9488\u53d8\u91cf\uff0c\u901a\u8fc7\u6307\u9488\u5f15\u7528\u5404\u7c7b\u578b\u6570\u636e




4\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u8fd0\u884c\u540e\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
main()
{ int a,b,c;
a=25;
b=025;
c=0x25;
printf("%d %d %d\n",a,b,c);
}


\u7b54\u6848\uff1a 25 21 37
\u8bc4\u6790\uff1a
\u672c\u9898\u8003\u67e5\u7684\u662f\u683c\u5f0f\u5b57\u7b26\u7684\u8f93\u51fa\u3002
\u53d8\u91cfa\u3001b\u3001c\u5206\u522b\u4e3a\u5341\u8fdb\u5236\u3001\u516b\u8fdb\u5236\u3001\u5341\u516d\u8fdb\u5236\u768425\uff0c\u683c\u5f0f\u5b57\u7b26d\u6240\u4ee3\u8868\u7684\u542b\u4e49\u662f\uff0c\u4ee5\u5e26\u7b26\u53f7\u7684\u5341\u8fdb\u5236\u5f62\u5f0f\u8f93\u51fa\u6574\u6570\uff08\u6b63\u6570\u4e0d\u8f93\u51fa\u7b26\u53f7\uff09\uff0c\u6240\u4ee5\u672c\u9898a=25\u5219\u8f93\u51fa\u503c\u4e3a25\uff1bb=025\u8f6c\u6362\u4e3a10\u8fdb\u5236\uff1ab=2*8+5=16+5=21\uff0c\u5219\u8f93\u51fa\u7684\u503c\u4e3a21\uff1bc=0x25\u8f6c\u6362\u4e3a10\u8fdb\u5236\uff1ac=2*16+5=32+5=37\uff0c\u5219\u8f93\u51fa\u7684\u503c\u4e3a37\uff0c\u800c\u4e14printf\u4e2d\u4e09\u4e2a%d\u4e4b\u7528\u7684\u662f\u7a7a\u683c\uff0c\u6240\u4ee5\u8f93\u51fa\u7684\u51e0\u4e2a\u6570\u5b57\u4e4b\u95f4\u4e5f\u5fc5\u987b\u662f\u7a7a\u683c\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u53d8\u91cf\u7684\u5b58\u50a8\u7c7b\u522b\uff0c\u53d8\u91cf\u7684\u4f5c\u7528\u57df\u548c\u751f\u5b58\u671f




5\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u8fd0\u884c\u540e\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
main ()
{ char a[]="Language",b[]="Programe";
char *p1,*p2; int k;
p1=a; p2=b;
for(k=0;k<=7;k++)
if(*(p1+k)==*(p2+k)) printf("%c",*(p1+k));
}


\u7b54\u6848\uff1a gae
\u8bc4\u6790\uff1a
\u672c\u9898\u8003\u67e5\u7684\u662f\u5b57\u7b26\u6307\u9488\u53d8\u91cf\u4e0e\u5b57\u7b26\u6570\u7ec4\u3002
\u89e3\u9898\u8fc7\u7a0b\uff1a
\uff081\uff09\u5f53k=0\u65f6\uff0c*(p1+0)='L'\uff0c*(p2+0)='P'\uff0cL!=P\uff0c\u6240\u4ee5\u6ca1\u6709\u8f93\u51fa
\uff082\uff09\u5f53k=1\u65f6\uff0c*(p1+1)='a'\uff0c*(p2+1)='r'\uff0ca!=r\uff0c\u6240\u4ee5\u6ca1\u6709\u8f93\u51fa
\uff083\uff09\u5f53k=2\u65f6\uff0c*(p1+2)='n'\uff0c*(p2+2)='o'\uff0cn!=o\uff0c\u6240\u4ee5\u6ca1\u6709\u8f93\u51fa
\uff084\uff09\u5f53k=3\u65f6\uff0c*(p1+3)='g'\uff0c*(p2+3)='g'\uff0cg==g\uff0c\u6240\u4ee5\u8f93\u51fag
\uff085\uff09\u5f53k=4\u65f6\uff0c*(p1+4)='u'\uff0c*(p2+4)='r'\uff0cu!=r\uff0c\u6240\u4ee5\u6ca1\u6709\u8f93\u51fa
\uff086\uff09\u5f53k=5\u65f6\uff0c*(p1+5)='a'\uff0c*(p2+5)='a'\uff0ca==a\uff0c\u6240\u4ee5\u8f93\u51faa
\uff087\uff09\u5f53k=6\u65f6\uff0c*(p1+6)='g'\uff0c*(p2+6)='m'\uff0cg!=m\uff0c\u6240\u4ee5\u6ca1\u6709\u8f93\u51fa
\uff088\uff09\u5f53k=7\u65f6\uff0c*(p1+7)='e'\uff0c*(p2+7)='e'\uff0ce==e\uff0c\u6240\u4ee5\u8f93\u51fae
\uff089\uff09\u5f53k=8\u65f6\u7ed3\u675f\u5faa\u73af
\uff0810\uff09\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1agae\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u6570\u7ec4\u7684\u5b9a\u4e49\u548c\u5f15\u7528/\u5b57\u7b26\u4e32\u4e0e\u5b57\u7b26\u6570\u7ec4




6\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u901a\u8fc7\u51fd\u6570SunFun\u548cf(x)\uff0cx=0\u523010\uff0c\u8fd9\u91ccf(x)=x^2+1\uff0c\u7531F\u51fd\u6570\u5b9e\u73b0\uff0c\u8bf7\u586b\u7a7a\u3002
main()
{ printf("The sun=%d\n",SunFun(10));}
SunFun(int n)
{ int x,s=0;
for(x=0;x<=n;x++)s+F(______);
return s;
}
F(int x)
{ return (______);}


\u7b54\u6848\uff1a 1\uff1ax
2\uff1ax*x+1
\u8bc4\u6790\uff1a
\u672c\u9898\u8003\u67e5\u7684\u662f\u51fd\u6570\u7684\u8c03\u7528\u3002
\u89e3\u9898\u8fc7\u7a0b\uff1a
\uff081\uff09f(x)\u7684\u542b\u4e49\u4e3ax\u7684\u5e73\u65b9\u52a0\u4e0a1
\uff082\uff09\u6240\u4ee5F(int x)\u7684\u8fd4\u56de\u503c\u5e94\u8be5\u4e3a x*x+1
\uff083\uff09SunFun(10)\u7684\u4f5c\u7528\u662f\u5c060\u523010\u4e4b\u95f4\u6240\u6709\u7684\u6574\u6570\u76f8\u52a0\u6c42\u548c
\uff084\uff09\u6240\u4ee5F()\u7684\u5f62\u5f0f\u53c2\u6570\u4e3ax\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




7\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u4e2d\uff0c\u51fd\u6570SumColumMin\u7684\u529f\u80fd\u662f\uff1a\u6c42\u51faM\u884cN\u5217\u4e8c\u7ef4\u6570\u7ec4\u6bcf\u5217\u5143\u7d20\u4e2d\u7684\u6700\u5c0f\u503c\uff0c\u5e76\u8ba1\u7b97\u5b83\u4eec\u7684\u548c\u503c\u3002\u548c\u503c\u901a\u8fc7\u5f62\u53c2\u4f20\u56de\u4e3b\u51fd\u6570\u8f93\u51fa\u3002\u8bf7\u586b\u7a7a\u3002
#define M2
#defineN4
void SumColumMin(int a[M][N],int *sum)
{ int i,j,k,s=0;
for(i=0;i<N;i++)
{ k=0;
for(j=1;j<M;j++)
if(a[k][i]>a[j][i])k=j;
s+=______ ;
}
______ =s;
}
main()
{ int x[M][N]={3,2,5,1,4,1,8,3},s;
SumColumMin(______);
printf("%d\n",s);
}


\u7b54\u6848\uff1a 1\uff1aa[k][i]
2\uff1a*sum
3\uff1ax,&s
\u8bc4\u6790\uff1a
\u672c\u9898\u8003\u67e5\u7684\u662f\u51fd\u6570\u53c2\u6570\u7684\u4f20\u9001\u3002
\u89e3\u9898\u8fc7\u7a0b\uff1a
\uff081\uff09 \u6267\u884c\u4ee5i\u4e3a\u53d8\u91cf\u7684for\u8bed\u53e5
1\uff09k=0
2\uff09\u6267\u884c\u4ee5j\u4e3a\u53d8\u91cf\u7684for\u8bed\u53e5
\u2460\u5f53j=1
\u2461\u6bd4\u8f83a[0][0]\u548ca[1][0]\u7684\u5927\u5c0f\uff0c\u5982\u679ca[0][0]\u5927\u4e8ea[1][0]\u5219k=1\uff1b\u5982\u679ca[0][0]\u5927\u4e8ea[1][0]\u5219k=0
\u2462j=2\u6240\u4ee5\u7ed3\u675f\u5faa\u73af
3\uff09\u6b64\u65f6a[k][i]\u5c31\u4ee3\u8868\u7b2c\u4e00\u5217\u4e2d\u6700\u5c0f\u7684\u503c\uff0c\u8981\u7d2f\u8ba1\u6240\u6709\u5217\u4e2d\u7684\u6700\u5c0f\u503c\u7684\u548c\uff0c\u5e94\u8be5\u5728\u7b2c\u4e00\u7a7a\u5185\u586b\u5199 a[k][i]\uff0c\u7528\u53d8\u91cfs\u7d2f\u52a0\u3002
\uff082\uff09 SumColumMin\u662f\u4e00\u4e2a\u65e0\u8fd4\u56de\u503c\u7684\u51fd\u6570\uff0c\u5176\u4e2d\u5f62\u5f0f\u53c2\u6570*sum\u662f\u4e00\u4e2a\u6307\u9488\u7c7b\u578b\uff0c\u6240\u4ee5\u7b2c\u4e8c\u7a7a\u5e94\u8be5\u586b\u5199 *sum\uff0c\u7528\u6765\u5c06\u8be5\u6307\u9488\u53d8\u91cf\u6307\u5411s
\uff083\uff09 \u5f53\u4e3b\u51fd\u6570main\u8c03\u7528SumColumMin\u65f6\uff0c\u9700\u8981\u4e24\u4e2a\u5b9e\u9645\u53c2\u6570\uff0c\u4e00\u4e2a\u4ee3\u8868\u88ab\u64cd\u4f5c\u7684\u6570\u7ec4\uff0c\u4e00\u4e2a\u4e3a\u6307\u5411\u7d2f\u8ba1\u548c\u7684\u6307\u9488\u53d8\u91cf\uff0c\u6240\u4ee5\u7b2c\u4e09\u4e2a\u7a7a\u5e94\u8be5\u4e3a x,&s\uff0c\u5206\u522b\u4ee3\u8868\u5df2\u7ecf\u88ab\u5b9a\u4e49\u7684\u6570\u7ec4x\uff0c\u548c\u6574\u578b\u53d8\u91cfs\u7684\u5730\u5740\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




8\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u7684\u8f93\u51fa\u7ed3\u679c\u662f \u3002
main()
{
int a=0;
a+=(a=8);
printf("%d\n",a);
}


\u7b54\u6848\uff1a 16
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u8868\u8fbe\u5f0f\u3002
\u8868\u8fbe\u5f0fa+=8\u76f8\u5f53\u4e8ea=a+8\uff0c\u5bf9\u8868\u8fbe\u5f0f\u9010\u6b65\u6c42\u89e3\u8fc7\u7a0b\u5982\u4e0b\uff1a
a+=(a+8)\u6b64\u65f6\uff0ca\u7684\u503c\u8d4b\u503c\u4e3a8\uff0c\u800c\u4e0d\u518d\u662f0\uff1b
a+=8
a=a+8
a=16
\u6545\u672c\u9898\u7b54\u6848\u4e3a16\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u5f62\u5f0f\u53c2\u6570\u4e0e\u5b9e\u5728\u53c2\u6570\uff0c\u53c2\u6570\u503c\u7684\u4f20\u9012




9\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
#define MAX(x,y)(x)>(y)?(x):(y)
main()
{
int a = 5, b = 2,c = 3, d = 3, t;
t = MAX(a + b, c + d)*10;
printf("%d\n", t);
}


\u7b54\u6848\uff1a 7
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u5b8f\u5b9a\u4e49\u3002
\u5b8f\u66ff\u6362\u540e\uff0c\u8868\u8fbe\u5f0ft = MAX(a + b, c + d)*10\u5373\u53d8\u4e3a\uff1at = (a+b)>(c+d) ? (a+b) : (c + d)*10;
\u7531\u4e8e(a+b)>(c+d)\u4e3a\u771f\uff0c \u6240\u4ee5t = (a+b)\uff0c\u5373\u4e3a7\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1a7\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u7f16\u8bd1\u9884\u5904\u7406/\u5b8f\u5b9a\u4e49\uff1a\u4e0d\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\uff1b\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49




10\u3001\u51fd\u6570mycmp(char *s,char *t)\u7684\u529f\u80fd\u662f\u6bd4\u8f83\u5b57\u7b26\u4e32s\u548ct\u7684\u5927\u5c0f\uff0c\u5f53s\u7b49\u4e8et\u65f6\u8fd4\u56de0\uff0c\u5f53s>t\u8fd4\u56de\u6b63\u503c\uff0c\u5f53s<t\u65f6\u8fd4\u56de\u8d1f\u503c\u3002\u8bf7\u586b\u7a7a\u3002
mycmp( char *s,char *t)
{ while (*s==*t)
{ if (*s=='\0')return 0;
++s;++t;
}
return(______);
}


\u7b54\u6848\uff1a *s-*t
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u6bd4\u8f83\u5b57\u7b26\u4e32\u7684\u5927\u5c0f\u3002
\u51fd\u6570\u7684\u4e24\u4e2a\u5f62\u53c2\u662f\u4e24\u4e2a\u5b57\u7b26\u6307\u9488\u53d8\u91cf\uff0c\u5b57\u7b26\u4e32\u7684\u9996\u5730\u5740\u662f\u6307\u9488\u53d8\u91cf\u7684\u503c\uff0c*s\u548c*t\u8868\u793a\u5b57\u7b26\u4e32\u6570\u7ec4s\u548ct\u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\uff0c\u5728while\u5faa\u73af\u4e2d\uff0c\u662f\u901a\u8fc7s\u548ct\u503c\u7684\u4e0d\u65ad\u53d8\u5316\u6539\u53d8\u4e24\u4e2a\u4e32\u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\uff0c\u8981\u8fd4\u56des\u548ct\u7684\u7b2c\u4e00\u4e2a\u4e0d\u540c\u5b57\u7b26\u7684ASCII\u7801\u7684\u5dee\u503c\uff0c\u5fc5\u987b\u4f7f\u7528"*s-*t"\u5f97\u51fa\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1a*s-*t\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u5e93\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528




11\u3001\u82e5\u7ed9fun\u51fd\u6570\u7684\u5f62\u53c2s\u4f20\u9001\u5b57\u7b26\u4e32\uff1a" 6354abc",\u5219\u51fd\u6570\u7684\u8fd4\u56de\u503c\u662f______\u3002\uff08\u5b57\u7b26\u4e32\u4e2d\u5305\u62ec\u7a7a\u683c\uff09
long fun(char s[ ])
{ long n; int sign;
for (; isspace(*s);s++);
sign=(*s=='-')?-1:1;
if (*s=='+' || *s=='-') s++;
for (n=0;isdigit(*s);s++)
n=10*n+(*s-'0');
return sign*n;
}


\u7b54\u6848\uff1a 6354
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002
\u8fd9\u4e2a\u51fd\u6570\u7684\u76ee\u7684\u662f\u63d0\u53d6\u51fa\u7531\u51fd\u6570\u7684\u5f62\u53c2\u4f20\u9001\u6765\u7684\u5b57\u7b26\u4e32\u4e2d\u7684\u6570\u5b57\u5b57\u7b26\uff0c\u5e76\u901a\u8fc7\u76f8\u5e94\u5404\u4e2a\u5b57\u7b26\u4f4d\u7f6e\u8ba1\u7b97\u51fa\u5b83\u4eec\u6570\u503c\u5f62\u5f0f\u7684\u5e42\uff0c\u6700\u540e\u8fd4\u56de\u5b57\u7b26\u4e32\u4e2d\u7684\u6570\u5b57\u5b57\u7b26\u7684\u6570\u503c\u5f62\u5f0f\uff0c\u6240\u4ee5\u51fd\u6570\u7684\u8fd4\u56de\u503c\u5e94\u5f53\u662f"6354"\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1a6354\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




12\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u6bb5\u7684\u8f93\u51fa\u7ed3\u679c\u4e3a______\u3002
char *p;int i,d;
p="PDP1-0";
for(i=0;i<7;i++)
{
d=isdigit(*(p+i) );
if(d!=0)
printf("%c\n",*(p+i) );
}


\u7b54\u6848\uff1a 1




\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u51fd\u6570isdigit()\u3002
\u8fd9\u6bb5\u7a0b\u5e8f\u7684\u76ee\u7684\u662f\u6309\u4ece\u5de6\u81f3\u53f3\u7684\u987a\u5e8f\u4ece\u5b57\u7b26\u4e32p\u4e2d\u627e\u51fa\u963f\u62c9\u4f2f\u6570\u5b57\u5b57\u7b26\uff0c\u5982\u679c\u627e\u5230\uff0c\u5c06\u5176\u6253\u5370\u51fa\u6765\u3002\u6700\u540e\u7684\u8f93\u51fa\u5e94\u5f53\u662f\uff1a
1
0


\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u5e93\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528




13\u3001\u4e0b\u5217\u7a0b\u5e8f\u4e2d\u5b57\u7b26\u4e32\u4e2d\u5404\u5355\u8bcd\u4e4b\u95f4\u6709\u4e00\u4e2a\u7a7a\u683c\uff0c\u5219\u7a0b\u5e8f\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
# include
main( )
{ char str1[ ]="How do you do", *p1=str1;
strcpy(str1+strlen(str1)/2,"es she");
printf("%s\n",p1);
}


\u7b54\u6848\uff1a How does she
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u5b57\u7b26\u4e32\u62f7\u8d1d\u51fd\u6570strcpy()\u3002
strlen(str1)\u662f\u6c42str1\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\uff0c\u4e3a13\uff0c\u7136\u540e\uff0c\u8fdb\u884c\u96642\u8fd0\u7b97\uff0c\u7ed3\u679c\u4e3a6\u3002strcpy()\u51fd\u6570\u662f\u628a\u5b57\u7b26\u4e32"es she"\u62f7\u8d1d\u5230str1\u540e\u7684\u7b2c6\u4e2a\u5b57\u7b26\u540e\u9762\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u62f7\u8d1d\u540e\u7684\u7ed3\u679c\u662f"How does she"\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1aHow does she\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u5e93\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528




14\u3001\u4e0b\u9762\u7684\u51fd\u6570strcat(str1,str2)\u5b9e\u73b0\u5c06\u5b57\u7b26\u4e32str2\u62fc\u63a5\u5230\u5b57\u7b26\u4e32str1\u540e\u9762\u7684\u529f\u80fd\u3002\u8bf7\u586b\u7a7a\u4f7f\u4e4b\u5b8c\u6574\u3002
char *strcat(str1,str2)
char *str1,*str2;
{ char *t=str1;
while(______)str1++;
while(______);
return(t);}


\u7b54\u6848\uff1a 1\uff1a*str1!='\0'
2\uff1a*str1++=*str2++
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u5b57\u7b26\u4e32\u8fde\u63a5\u51fd\u6570strcat()\u3002
\u51fd\u6570strcat(str1,str2)\u5b9e\u73b0\u5c06\u5b57\u7b26\u4e32str2\u8fde\u63a5\u5230\u5b57\u7b26\u4e32str1\u540e\u9762\uff0c\u6240\u4ee5\u9996\u5148\u8981\u627e\u5230\u5b57\u7b26\u4e32str1\u7684\u4e32\u5c3e\uff0c\u6839\u636eC\u8bed\u8a00\u7684\u8bed\u6cd5\u89c4\u5b9a\uff0c\u4e00\u4e2a\u4e32\u7684\u4e32\u5c3e\u4e00\u5b9a\u662f\u4e00\u4e2a\u9690\u542b\u5b57\u7b26"\0"\uff0c\u800c\u5728\u7a0b\u5e8f\u4e2d\uff0c\u5bf9\u5b57\u7b26\u4e32\u4e2d\u5b57\u7b26\u7684\u8bbf\u95ee\u662f\u901a\u8fc7\u4e24\u4e2a\u6307\u9488\u53d8\u91cf\u6765\u5b8c\u6210\u7684\uff0c\u56e0\u6b64\u8981\u627e\u5230\u5b57\u7b26\u4e32str1\u7684\u4e32\u5c3e\uff0c\u8981\u5224\u65ad*str1\u662f\u5426\u4e3a"\0"\uff0c\u8981\u627e\u5230\u5b57\u7b26\u4e32str2\u7684\u4e32\u5c3e\uff0c\u8981\u5224\u65ad*str2\u662f\u5426\u4e3a"\0"\uff0c\u7a0b\u5e8f\u4e2d\u5fc5\u987b\u53ef\u4ee5\u4f7f\u5b57\u7b26\u4e32\u4e2d\u5b57\u7b26\u9010\u4e00\u987a\u5e8f\u4f53\u73b0\uff0c\u6240\u4ee5\u5728\u9898\u4e2d\u6211\u4eec\u5e94\u586b\u5199"*str1"\u548c"*str1++=*str2++ "\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u5e93\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528




15\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
void fun()
{ static int a=0;
a +=2; printf("%d",a);
}
main()
{ int cc;
for(cc=1;cc<4;cc++) fun();
printf("\n");
}


\u7b54\u6848\uff1a 246
\u8bc4\u6790\uff1a
\u5faa\u73affor(cc=1;cc<4;cc++)\u88ab\u6267\u884c\u4e863\u6b21\u3002\u5728\u51fd\u6570fun\u4e2d\uff0c\u7531\u4e8ea\u662fstatic\u578b\u53d8\u91cf\uff0c\u6240\u4ee5\u51fd\u6570\u7b2c1\u6b21\u8c03\u7528\u540e\uff0ca= 2\uff1b\u7b2c2\u6b21\u8c03\u7528\u540e\uff0ca = 4\uff1b\u7b2c3\u6b21\u8c03\u7528\u540e\uff0ca = 6\u3002


\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




16\u3001\u82e5\u8981\u4f7f\u6307\u9488p\u6307\u5411\u4e00\u4e2adouble\u7c7b\u578b\u7684\u52a8\u6001\u5b58\u50a8\u5355\u5143\uff0c\u8bf7\u586b\u7a7a\u3002
p=______malloc(sizeof (double));


\u7b54\u6848\uff1a (double*)
\u8bc4\u6790\uff1a
\u51fd\u6570malloc\u8fd4\u56de\u7684\u662fvoid*\u800c\u4e0d\u662fdouble\u7c7b\u578b\u6307\u9488\u3002\u6240\u4ee5\u8981\u4f7f\u6307\u9488p\u6307\u5411\u4e00\u4e2adouble\u7c7b\u578b\u7684\u5b58\u50a8\u5355\u5143\u5c31\u5fc5\u987b\u8fdb\u884c\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u7c7b\u578b\u548c\u8fd4\u56de\u503c




17\u3001\u4e0b\u5217\u7a0b\u5e8f\u6bb5\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
main()
{ char b[]="Hello,you";
b[5]=0;
printf("%s\n",b);
}


\u7b54\u6848\uff1a Hello
\u8bc4\u6790\uff1a
\u5b57\u7b26\u4e32\u4e2d\uff0c\u6570\u503c0\u6216\u7b26\u53f7'\0'\u8868\u793a\u5b57\u7b26\u4e32\u7684\u7ed3\u675f\u3002\u672c\u9898\u4e2d\uff0cb[5]\u88ab\u8d4b\u4e860\u503c\uff0c\u8868\u660e\u5b57\u7b26\u4e32b\u7684\u7b2c\u516d\u4e2a\u5b57\u7b26\u5c31\u662f\u7ed3\u675f\u6807\u5fd7\u3002\u56e0\u6b64\uff0c\u53ea\u8f93\u51fa\u524d\u4e94\u4e2a\u5b57\u7b26\uff0c\u5373Hello\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u6570\u7ec4\u7684\u5b9a\u4e49\u548c\u5f15\u7528/\u4e00\u7ef4\u6570\u7ec4\u548c\u591a\u7ef4\u6570\u7ec4\u7684\u5b9a\u4e49\u3001\u521d\u59cb\u5316\u548c\u5f15\u7528




18\u3001\u4e0b\u5217\u7a0b\u5e8f\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
void fun(int *n)
{ while((*n)--);
printf("%d",++(*n));
}
main()
{ int a=100;
fun(&a);
}


\u7b54\u6848\uff1a 0
\u8bc4\u6790\uff1a
\u5728\u51fd\u6570fun()\u4e2d\uff0cwhile((*n)--)\u662f\u5148\u5f15\u7528*n\u7684\u503c\uff0c\u518d\u505a(*n)-- \u8fd0\u7b97\uff0c\u6240\u4ee5\u5faa\u73af\u7ed3\u675f\u65f6*n\u7684\u503c\u4e3a0\uff0c\u518d\u505a(*n)-- \u8fd0\u7b97\u540e\uff0c*n\u7684\u503c\u4e3a-1\uff1b\u6267\u884c++(*n)\u540e\uff0c*n\u7684\u503c\u662f0\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




19\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u4e2d\uff0c\u4e3b\u51fd\u6570\u8c03\u7528\u4e86LineMax\u51fd\u6570\uff0c\u5b9e\u73b0\u5728N\u884cM\u5217\u7684\u4e8c\u7ef4\u6570\u7ec4\u4e2d\uff0c\u627e\u51fa\u6bcf\u4e00\u884c\u4e0a\u7684\u6700\u5927\u503c\u3002\u8bf7\u586b\u7a7a\uff1a
#define N 3
#define M 4
void LineMax(int x[N][M])
{ int i,j,p;
for(i=0;i<N;i++)
{ p=0;
for(j=1;j<M;j++)
if(x[i][p]<x[i][j])______;
printf("The max value in line %d is %d\n",i,______);
}
}
main()
{ int x[N][M]={1,.5,7,4,2,6,4,3,8,2, 3,1};
______;
}


\u7b54\u6848\uff1a 1\uff1ap=j
2\uff1aa[i][p]
3\uff1aLineMax(x)
\u8bc4\u6790\uff1a
LineMax\u51fd\u6570\u4e2d\u8fd0\u7528\u4e86\u4e24\u4e2a\u5faa\u73af\uff0c\u5916\u5faa\u73af\u6765\u63a7\u5236\u6570\u7ec4\u7684\u884c\uff0c\u5185\u5faa\u73af\u63a7\u5236\u5217\uff0c\u5728\u5bfb\u627e\u6bcf\u884c\u6700\u5927\u7684\u5143\u7d20\u65f6\uff0c\u5148\u628a\u6bcf\u884c\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u5217\u4e0b\u6807\u53730\u8d4b\u7ed9p\uff0c\u7136\u540e\u628a\u540e\u9762\u7684\u6570\u9010\u4e00\u4e0e\u4e4b\u6bd4\u8f83\uff0c\u5982\u679c\u5927\u4e8e\u5b83\uff0c\u5219\u628a\u5927\u7684\u6570\u7684\u5217\u4e0b\u6807\u91cd\u65b0\u8d4b\u7ed9p\u3002
\u6240\u4ee5(1)\u5904\u5e94\u8be5\u586bp=j\uff1b
\u5185\u5faa\u73af\u7ed3\u675f\u540e\uff0c\u4fbf\u83b7\u5f97\u4e86\u672c\u884c\u4e2d\u6700\u5927\u7684\u6570\uff0c\u5373a[i][p]\uff0c\u8fd9\u4e5f\u5c31\u662f(2)\u5904\u5e94\u8be5\u586b\u5199\u7684\u7b54\u6848\uff1b
\u800c(3)\u5904\uff0c\u5f88\u663e\u7136\u662f\u8981\u8c03\u7528\u51fd\u6570\uff0c\u5173\u952e\u5c31\u5728\u4e8e\u53c2\u6570\u600e\u4e48\u5199\uff0c\u51fd\u6570\u4e2d\u9700\u8981\u7684\u662f\u6574\u4e2a\u6570\u7ec4\uff0c\u6240\u4ee5\u5e94\u8be5\u628a\u6570\u7ec4\u540d\u505a\u4e3a\u5b9e\u53c2\uff0c\u4f20\u9012\u8fc7\u53bb\uff0c(3)\u5904\u7684\u7b54\u6848\u5e94\u8be5\u662fLineMax(x)\u3002\u6ce8\u610f\u5927\u5c0f\u5199\uff0cC\u8bed\u8a00\u4e2d\u5927\u5c0f\u5199\u662f\u4e0d\u7b49\u4ef7\u7684\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




20\u3001\u82e5\u6709\u5982\u4e0b\u7ed3\u6784\u4f53\u8bf4\u660e:
struct STRU
{ int a,b;char c: double d;
struct STRU *p1,*p2;
};
\u8bf7\u586b\u7a7a\uff0c\u4ee5\u5b8c\u6210\u5bf9t\u6570\u7ec4\u7684\u5b9a\u4e49\uff0ct\u6570\u7ec4\u7684\u6bcf\u4e2a\u5143\u7d20\u4e3a\u8be5\u7ed3\u6784\u4f53\u7c7b\u578b\u3002
______t[20]


\u7b54\u6848\uff1a struct STRU
\u8bc4\u6790\uff1a
\u672c\u9898\u4e3b\u8981\u8003\u67e5\u8003\u751f\u5bf9C\u8bed\u8a00\u4e2d\u7ed3\u6784\u4f53\u7684\u638c\u63e1\u3002
\u3000\u3000\u7ed3\u6784\u4f53\u7c7b\u578b\u662f\u6784\u9020\u6570\u636e\u7c7b\u578b\uff0c\u662f\u7528\u6237\u81ea\u5df2\u5b9a\u4e49\u7684\u4e00\u79cd\u7c7b\u578b\u3002
\u3000\u3000\u7ed3\u6784\u4f53\u7c7b\u578b\u7684\u5b9a\u4e49\uff1a
\u3000\u3000\u3000\u3000struct \u7ed3\u6784\u4f53\u7c7b\u578b\u540d
\u3000\u3000\u3000\u3000\u3000{
\u6210\u5458\u9879\u8868;
};
\u5b9a\u4e49\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u7684\u5f62\u5f0f\u4e3a\uff1a
\u3000\u3000struct \u7ed3\u6784\u4f53\u7c7b\u578b\u540d\u3000\u53d8\u91cf1,\u53d8\u91cf2,...
\u5176\u4e2d\u53d8\u91cf\u5305\u62ec\uff1a\u4e00\u822c\u53d8\u91cf\u3001\u6307\u9488\u53d8\u91cf\u3001\u6570\u7ec4\u53d8\u91cf\u7b49\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u6570\u7ec4\u7684\u5b9a\u4e49\u548c\u5f15\u7528/\u4e00\u7ef4\u6570\u7ec4\u548c\u591a\u7ef4\u6570\u7ec4\u7684\u5b9a\u4e49\u3001\u521d\u59cb\u5316\u548c\u5f15\u7528




21\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u8fd0\u884c\u540e\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
void fun(int x,int y)
{x=x+y;y=x-y;x=x-y;
printf("%d,%d,",x,y);}
main()
{int x=2,y=3;
fun(x,y);
printf("%d,%d\n",x,y);
}




\u7b54\u6848\uff1a 3,2,2,3
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u4ea4\u6362\u53d8\u91cf\u7684\u503c\u3002
\u88ab\u8c03\u51fd\u6570fun()\u5b9e\u73b0\u7684\u529f\u80fd\u662f\u4ea4\u6362\u53d8\u91cfx\u548cy\u7684\u503c\u5e76\u6253\u5370\uff0c\u7531\u4e8e\u8be5\u51fd\u6570\u65e0\u8fd4\u56de\u503c\uff0c\u6240\u4ee5\u5728\u4e3b\u51fd\u6570\u4e2d\u6253\u5370\u51fa\u7684x\u548cy\u7684\u503c\u4ecd\u7136\u4e3a2,3\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1a3,2,2,3\u3002


\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u5f62\u5f0f\u53c2\u6570\u4e0e\u5b9e\u5728\u53c2\u6570\uff0c\u53c2\u6570\u503c\u7684\u4f20\u9012




22\u3001\u4e0b\u9762\u7a0b\u5e8f\u7684\u8fd0\u884c\u7ed3\u679c\u662f\uff1a______\u3002
#define N 10
#define s(x) x*x
#define f(x) (x*x)
main()
{int i1,i2;
i1=1000/s(N);i2=1000/f(N);
printf("%d %d\n",i1,i2);
}




\u7b54\u6848\uff1a 1000 10
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u5b8f\u5b9a\u4e49\u3002
\u6839\u636e\u5b8f\u5b9a\u4e49\uff0c\u53d8\u91cfi1\u7684\u503c\u4e3a1000/10*10=1000\uff0c\u53d8\u91cfi2\u7684\u503c\u4e3a1000/(10*10)=10\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1a1000\u548c10\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u7f16\u8bd1\u9884\u5904\u7406/\u5b8f\u5b9a\u4e49\uff1a\u4e0d\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\uff1b\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49




23\u3001\u4e0b\u9762\u7a0b\u5e8f\u7684\u8fd0\u884c\u7ed3\u679c\u662f\uff1a______\u3002
void swap(int *a,int *b)
{int *t;
t=a;a=b;b=t;
}
main()
{int x=3,y=5,*p=&x,*q=&y;
swap(p,q);
printf("%d%d\n",*p,*q);
}


\u7b54\u6848\uff1a 35
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u51fd\u6570\u8c03\u7528\u3002
\u89c2\u5bdf\u672c\u9898\u7684\u7a0b\u5e8f\u53ef\u4ee5\u770b\u51fa\uff0c\u88ab\u8c03\u51fd\u6570swap()\u5b9e\u73b0\u7684\u529f\u80fd\u662f\u4ea4\u6362\u53d8\u91cf\u7684\u503c\uff0c\u4f46\u7531\u4e8e\u51fd\u6570\u4e0d\u8fd4\u56de\u4efb\u4f55\u503c\uff0c\u6240\u4ee5\u5728main()\u51fd\u6570\u4e2d\u6253\u5370\u51fa\u7684\u53d8\u91cf\u7684\u503c\u5e76\u6ca1\u6709\u53d1\u751f\u4ea4\u6362\uff0c\u5373\u4ecd\u4e3a3\u548c5\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1a3\u548c5\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u7c7b\u578b\u548c\u8fd4\u56de\u503c




24\u3001fun\u51fd\u6570\u7684\u529f\u80fd\u662f\uff1a\u9996\u5148\u5bf9a\u6240\u6307\u7684N\u884cN\u5217\u7684\u77e9\u9635\uff0c\u627e\u51fa\u5404\u884c\u4e2d\u7684\u6700\u5927\u7684\u6570\uff0c\u518d\u6c42\u8fd9N\u4e2a\u6700\u5927\u503c\u4e2d\u7684\u6700\u5c0f\u7684\u90a3\u4e2a\u6570\u4f5c\u4e3a\u51fd\u6570\u503c\u8fd4\u56de\u3002\u8bf7\u586b\u7a7a\u3002
#include
#define N 100
int fun(int(*a)[N])
{int row,col,max,min;
for(row=0;row<N;row++)
{for(max=a[row][0],col=1;col<N;col++)
if(______) max=a[row][col];
if(row==0) min=max;
else if(______) min=max;
}
return min;
}




\u7b54\u6848\uff1a 1\uff1amax<a[row][col]
2\uff1amax<min
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u6c42\u77e9\u9635\u6700\u5927\u503c\u7684\u7b97\u6cd5\u3002
\u672c\u9898\u4e2d\u7684\u7b2c\u4e00\u7a7a\u8981\u6c42\u5224\u65ad\u51fa\u6bcf\u4e00\u884c\u4e2d\u7684\u6700\u5927\u6570\uff0c\u5e94\u8be5\u586b\u5199\u6761\u4ef6max<a[row][col]\uff0c\u7b2c\u4e8c\u7a7a\u8981\u6c42\u4eceN\u4e2a\u6700\u5927\u503c\u4e2d\u627e\u51fa\u6700\u5c0f\u7684\u6570\uff0c\u5e94\u586b\u5165\u6761\u4ef6max<min\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1amax<a[row][col]\u548cmax<min\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




25\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
#define MCRA(m) 2*m
#define MCRB(n,m) 2*MCRA(n)+m
main()
{ int i=2,j=3;
printf("%d\n",MCRB(j,MCRA(i)));
}


\u7b54\u6848\uff1a 16
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662f\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\u3002
\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\u662f\u8fd9\u6837\u5c55\u5f00\u7f6e\u6362\u7684\uff1a\u5728\u7a0b\u5e8f\u4e2d\u5982\u679c\u6709\u5e26\u5b9e\u53c2\u7684\u5b8f\uff0c\u5219\u6309#define \u547d\u4ee4\u884c\u4e2d\u6307\u5b9a\u7684\u5b57\u7b26\u4e32\u4ece\u5de6\u5230\u53f3\u8fdb\u884c\u7f6e\u6362\u3002\u5982\u679c\u4e32\u4e2d\u5305\u542b\u5f62\u53c2\uff0c\u5219\u5c06\u7a0b\u5e8f\u8bed\u53e5\u4e2d\u76f8\u5e94\u7684\u5b9e\u53c2\uff08\u53ef\u4ee5\u662f\u5e38\u91cf\u3001\u53d8\u91cf\u6216\u8868\u8fbe\u5f0f\uff09\u4ee3\u66ff\u5f62\u53c2\uff0c\u5982\u679c\u5b8f\u5b9a\u4e49\u4e2d\u7684\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\u4e0d\u662f\u53c2\u6570\u5b57\u7b26\uff0c\u5219\u4fdd\u7559\u3002\u56e0\u6b64\u5bf9MCRB(j,MCRA(i))\u8fdb\u884c\u5b8f\u5c55\u5f00\u5c31\u5f97\u5230\u4e862*MCRA(j)+MCRA(i)\uff0c\u5373\uff1a2*2*j+2*i=2*2*3+2*2=16\u3002
\u6545\u672c\u9898\u7b54\u6848\u4e3a\uff1a16\u3002

\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u7f16\u8bd1\u9884\u5904\u7406/\u5b8f\u5b9a\u4e49\uff1a\u4e0d\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\uff1b\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49




26\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u8c03\u7528\u51fd\u6570fun\u8ba1\u7b97\uff1am=1-2+3-4+\u2026+9-10\uff0c\u5e76\u8f93\u51fa\u7ed3\u679c\u3002\u8bf7\u586b\u7a7a\u3002
int fun ( int n)
{ int m=0,f=1,i;
for(i=1; i<=n; i++)
{ m+=i*f;
f=______;
}
return m;
}
main()
{ printf("m=%d\n",______);}


\u7b54\u6848\uff1a 1\uff1a-f
2\uff1afun(10)
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662fC\u7a0b\u5e8f\u8bbe\u8ba1\u3002\u6839\u636e\u7a0b\u5e8f\u5199\u51fa\u8fd0\u884c\u7ed3\u679c\u3002
\u8003\u5bdf\u7684\u77e5\u8bc6\u70b9\u4e3b\u8981\u662f\u51fd\u6570\u7684\u8c03\u7528\u3002\u672c\u9898\u5229\u7528\u4e00\u4e2afun\u51fd\u6570\u6765\u5b8c\u6210\u9898\u76ee\u8981\u6c42\u7684\u8ba1\u7b97\u3002\u7a0b\u5e8f\u4e2df\u8d77\u7684\u4f5c\u7528\u662f\u63a7\u5236i*f\u7684\u7b26\u53f7\uff0c\u770b\u7684\u51fa\uff0c\u5076\u6570\u4f4d\u90fd\u4e3a\u8d1f\u503c\uff0c\u6240\u4ee5f\u7684\u503c\u4e3a(-1)^(i+1)\uff0c\u6700\u540e\u8981\u6c42\u8f93\u51fam\u7684\u503c\uff0c\u5728\u8f93\u51fa\u4e2d\u8c03\u7528fun\u51fd\u6570\uff0c\u5e76\u628a\u5b9e\u53c210\u4f20\u7ed9n\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




27\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u8fd0\u884c\u540e\u7684\u8f93\u51fa\u7ed3\u679c\u662f______\u3002
main()
{ int i,n[]={0,0,0,0,0};
for(i=1;i<=4;i++)
{ n[i]=n[i-1]*2+1;
printf("%d ",n[i]);
}
}


\u7b54\u6848\uff1a 1 3 7 15
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662fC\u7a0b\u5e8f\u8bbe\u8ba1\u3002\u6839\u636e\u7a0b\u5e8f\u5199\u51fa\u8fd0\u884c\u7ed3\u679c\u3002
\u8be5\u7a0b\u5e8f\u8003\u5bdf\u7684\u662f\u6570\u7ec4\u7684\u77e5\u8bc6\u70b9\uff0cn\u662f\u4e00\u4e2a\u67095\u4e2a\u5143\u7d20\uff0c\u4e14\u5143\u7d20\u503c\u5168\u4e3a0\u7684\u6570\u7ec4\u3002\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u65f6\u5148\u8fdb\u884cfor\u5faa\u73af\uff0ci=1\u65f6\uff0cn[1]=n[0]*2+1\uff0c\u6b64\u65f6n[1]=1\uff1b\u6267\u884ci++\uff1bi=2\u65f6\uff0c\u518d\u8fdb\u884c\u5faa\u73af\uff0cn[2]=n[1]*2+1\uff0c\u6b64\u65f6n[2]=3\uff0c\u518d\u6267\u884ci++\uff0c\u6b64\u65f6i=3\uff0c\u7ee7\u7eed\u5faa\u73af\uff0cn[3]=n[2]*2+1\uff0c\u6b64\u65f6n[3]=7\uff0c\u7136\u540ei=4\u65f6\uff0cn[4]=n[3]*2+1\uff0c\u6b64\u65f6n[4]=15\u3002\u5faa\u73af\u7ed3\u675f\u3002\u6ce8\u610f\u8f93\u51fa\u51fd\u6570\u4e2d%d\u540e\u6709\u7a7a\u683c\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u6570\u7ec4\u7684\u5b9a\u4e49\u548c\u5f15\u7528/\u4e00\u7ef4\u6570\u7ec4\u548c\u591a\u7ef4\u6570\u7ec4\u7684\u5b9a\u4e49\u3001\u521d\u59cb\u5316\u548c\u5f15\u7528




28\u3001\u8bf7\u5728\u4ee5\u4e0b\u7a0b\u5e8f\u7b2c\u4e00\u884c\u7684\u4e0b\u5212\u7ebf\u5904\u586b\u5199\u9002\u5f53\u5185\u5bb9\uff0c\u4f7f\u7a0b\u5e8f\u80fd\u6b63\u5e38\u8fd0\u884c\u3002
______( double,double);
main()
{ double x,y;
scanf("%1f%1f",&x,&y);
printf(%1f\n",max(x,y));
}
double max(double a,double b)
{ return(a>b ? a:b);}


\u7b54\u6848\uff1a double max
\u8bc4\u6790\uff1a
\u672c\u9898\u7684\u8003\u67e5\u70b9\u662fC\u7a0b\u5e8f\u8bbe\u8ba1\u3002\u8c03\u8bd5\u7a0b\u5e8f\uff0c\u628a\u4e0d\u5b8c\u5584\u7684\u7a0b\u5e8f\u8fdb\u884c\u4fee\u6539\u548c\u8865\u5145\uff0c\u4f7f\u4e4b\u80fd\u5f97\u5230\u6b63\u786e\u7684\u7ed3\u679c\u3002
\u4e3b\u51fd\u6570\u91cc\u53ef\u4ee5\u770b\u5230\u8c03\u7528\u4e86\u4e00\u4e2amax\u51fd\u6570\uff0c\u51fd\u6570\u5728\u88ab\u8c03\u7528\u4e4b\u524d\u9700\u8981\u5148\u5b9a\u4e49\uff0c\u6240\u4ee5\u8981\u6c42\u586b\u7a7a\u7684\u5185\u5bb9\u5e94\u8be5\u662f\u5bf9\u51fd\u6570\u8fdb\u884c\u5b9a\u4e49\u7684\u8bed\u53e5\u3002\u7531\u9898\u76ee\u5185\u5bb9\u4e5f\u53ef\u4ee5\u770b\u51fa\u6b64\u51fd\u6570\u662fdouble\u578b\u7684\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u51fd\u6570\u7684\u6b63\u786e\u8c03\u7528\uff0c\u5d4c\u5957\u8c03\u7528\uff0c\u9012\u5f52\u8c03\u7528




29\u3001\u6709\u4ee5\u4e0b\u7a0b\u5e8f
void f(int y,int *x)
{ y=y+*x; *x=*x+y;}
main()
{ int x=2,y=4;
f(y,&x);
printf("%d %d\n",x,y);
}
\u6267\u884c\u540e\u8f93\u51fa\u7684\u7ed3\u679c______\u3002








\u7b54\u6848\uff1a 8 4
\u8bc4\u6790\uff1a
f\u51fd\u6570\u4e2d\u53d8\u91cfx\u4f20\u9012\u7684\u662f\u53d8\u91cf\u7684\u5730\u5740\uff0c\u53ef\u4ee5\u5b9e\u73b0\u503c\u7684\u53d8\u6362\uff0c\u800c\u53d8\u91cfy\u662f\u4f20\u9012\u7684\u503c\uff0c\u6267\u884c\u5b8cf\u540e\uff0cy\u7684\u503c\u662f\u53d8\u4e86\uff0c\u4f46main\u51fd\u6570\u4e2d\u7684y\u5e76\u672a\u53d8\u5316\u3002\u4e5f\u5c31\u662f\u8bf4\u7531\u4e8e"\u5355\u5411\u4f20\u9001"\u7684"\u503c\u4f20\u9012"\u65b9\u5f0f\uff0c\u5f62\u53c2\u503c\u7684\u6539\u53d8\u65e0\u6cd5\u4f20\u7ed9\u5b9e\u53c2\u3002
\u77e5\u8bc6\u70b9\uff1a\u77e5\u8bc6\u70b9/\u51fd\u6570/\u5f62\u5f0f\u53c2\u6570\u4e0e\u5b9e\u5728\u53c2\u6570\uff0c\u53c2\u6570\u503c\u7684\u4f20\u9012


31\u3001C\u8bed\u8a00\u7a0b\u5e8f\u7684\u57fa\u672c\u5355\u4f4d\u662f______
\u7b54\u6848\uff1a\u51fd\u6570
32\u3001\u8bbe\u6709\u8bf4\u660e\u8bed\u53e5:char a= '\72';\u5219\u53d8\u91cfa\u5305\u542b______\u4e2a\u5b57\u7b26\u3001
\u7b54\u6848\uff1a1
33\u3001c\u8bed\u8a00\u662f\u4e00\u79cd______\uff08\u9009\u62e9\u9762\u5411\u5bf9\u8c61\u6216\u9762\u5411\u8fc7\u7a0b\uff09\u9ad8\u7ea7\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u3002
\u7b54\u6848\uff1a\u9762\u5411\u8fc7\u7a0b
34\u3001C\u8bed\u8a00\u4e2d\u552f\u4e00\u7684\u4e09\u76ee\u8fd0\u7b97\u7b26\u662f______
\u7b54\u6848\uff1a\u6761\u4ef6\u8fd0\u7b97\u7b26#? :
35\u3001C\u8bed\u8a00\u4e2d\u7ed3\u675f\u4e00\u6b21\u5faa\u73af\u7684\u8bed\u53e5\u662f______
\u7b54\u6848\uff1acontinue
36\u3001C\u8bed\u8a00\u4e2d\u7ed3\u675f\u6574\u4e2a\u5faa\u73af\u7684\u8bed\u53e5\u662f______
\u7b54\u6848\uff1abreak
37\u3001\u4e8c\u7ef4\u6570\u7ec4a\u4e2d\u5143\u7d20a[2][2]\u7684\u503c\u662f______ a[4][5]\uff1d{{1,2,3},{3,2,1,6},{1}}\uff1b
\u7b54\u6848\uff1a0
38\u3001\u5199\u51fa\u4e0b\u9762\u4e2a\u903b\u8f91\u8868\u8fbe\u5f0f\u7684\u503c\uff0c\u8bbea=3,b=4,\u5219c=5 a || b+c && b-c=______
\u7b54\u6848\uff1a1
39\u3001\u5199\u51fa\u4e0b\u9762\u4e2a\u903b\u8f91\u8868\u8fbe\u5f0f\u7684\u503c\uff0c\u8bbea=3,b=4,\u5219! (a+b)+c \u20131 && b+ c/2 =______
\u7b54\u6848\uff1a1
40\u3001\u5728C\u8bed\u8a00\u4e2d\u6253\u5f00\u6587\u4ef6\u7684\u51fd\u6570\u540d\u79f0\u662f______
\u7b54\u6848\uff1afopen#fopen()
41\u3001\u5728C\u8bed\u8a00\u4e2d\u5173\u95ed\u6587\u4ef6\u7684\u51fd\u6570\u540d\u79f0\u662f______
\u7b54\u6848\uff1afclose#fclose()
42\u3001C\u8bed\u8a00\u4e2d\u57fa\u672c\u7684\u6570\u636e\u7c7b\u578b\u6709______
\u7b54\u6848\uff1aint float char # \u6574\u578b \u5b9e\u578b \u5b57\u7b26\u578b
43\u3001\u8bbey\u662fint\u578b\u53d8\u91cf,\u8bf7\u5199\u51fa\u5224\u65ady\u4e3a\u5947\u6570\u7684\u5173\u7cfb\u8868\u8fbe______
\u7b54\u6848\uff1ay%2!=0 # y%2==1 # y%2
44\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u8fd0\u884c\u540e\u7684\u8f93\u51fa\u7ed3\u679c\u662f______
main()
{ int i=10,j=0;
do
{ j=j+i; i-;
while(i>2);
printf("%d\n",j);
}
\u7b54\u6848\uff1a52
45\u3001\u8bbe\u6709\u4ee5\u4e0b\u7a0b\u5e8f:
main()
{ int n1,n2;
scanf("%d",&n2);
while(n2!=0)
{ n1=n2%10;
n2=n2/10;
printf("%d",n1);
}
}
\u7a0b\u5e8f\u8fd0\u884c\u540e,\u5982\u679c\u4ece\u952e\u76d8\u4e0a\u8f93\u51651298;\u5219\u8f93\u51fa\u7ed3\u679c\u4e3a______
\u7b54\u6848\uff1a8921


46\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u8f93\u51fa\u7684\u6700\u540e\u4e00\u4e2a\u503c\u662f______
int ff(int n)
{ static int f=1;
f=f*n;
return f;
}
main()
{ int i;
for(i=1;i<=5;i++) printf("%d\n",ff(i));
}
\u7b54\u6848\uff1a120
47\u3001\u8bbe\u6709\u4ee5\u4e0b\u7a0b\u5e8f:
main()
{ int a, b, k=4, m=6, *p1=&k, *p2=&m;
a=pl==&m;
b=(*p1)/(*p2)+7;
printf("a=%d\n",a);
printf("b=%d\n",b);
}
\u6267\u884c\u8be5\u7a0b\u5e8f\u540e,a\u7684\u503c\u4e3a______b\u7684\u503c\u4e3a______
\u7b54\u6848\uff1a0 @ 7
48\u3001 \u51fd\u6570fun\u7684\u529f\u80fd\u662f\uff1a\u7d2f\u52a0\u6570\u7ec4\u5143\u7d20\u4e2d\u7684\u503c\u3002n\u4e3a\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u4e2a\u6570\u3002\u7d2f\u52a0\u7684\u548c\u503c\u653e\u5165x\u6240\u6307\u7684\u5b58\u50a8\u5355\u5143\u4e2d\u3002
fun(int b[], int n ,int *y)
{for(k=0;______;k++) r=r+b[k];
*y=______;
}
\u7b54\u6848\uff1ak<n @ r
51\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u8fd0\u884c\u540e\u7684\u8f93\u51fa\u7ed3\u679c\u662f______
main()
{ char m;
m='B'+32; printf("%c",m);
}
\u7b54\u6848\uff1ab




52\u3001\u4ee5\u4e0b\u7a0b\u5e8f\u8fd0\u884c\u540e\u7684\u8f93\u51fa\u7ed3\u679c\u662f______
main()
{ int a=1,b=3,c=5;
if (c=a+b) printf("yes\n");
else printf("no\n");
}
\u7b54\u6848\uff1ayes

z最后值是1。

解:每个if判断条件,只控制其后的一个句子,也就是if之后,第一个分号之前,当然,你可以用大括号把若干句子括到一起,作为一个句子,以使if之后执行多个句子。

所以,x 然后继续程序,执行x=y,此时,x=2,y=2,z=1

最后,执行y=z,此时,x=2,z=1;

因为x=1,z=x=1;

x=y=2;

y=z=x=1;

扩展资料:

Int是将一个数值向下取整为最接近的整数的函数。INT是数据库中常用函数中的取整函数,常用来判别一个数能否被另一个数整除。在编程语言(C、C++、C#、Java等)中,常用于定义整数类型变量的标识符。

在一般的电脑中,int占用4字节,32比特,数据范围为-2147483648~2147483647[-2^31~2^31-1];

在之前的微型机中,int占用2字节,16比特,数据范围为-32768~32767[-2^15~2^15-1];

使用printf输出int占用字节数量:

printf("%d",sizeof(int));

除了int类型之外,还有short、long、long long类型可以表示整数。

unsigned int 表示无符号整数,数据范围为[0~2^32-1]。



扩展阅读:万能计算器 ... 中英文自动翻译器 ... int x 2 z ++x+1 ... int x 2 y 3 z 4 ... int a=2 ... 解方程 ... 功能计算器 ... x+y=10 ... x=sint ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网