这些都要填什么空啊第11题 #include <stdio.h>#define N 3void zz(int x[N][
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/26 18:32:12
这些都要填什么空啊
第11题
#include <stdio.h>
#define N 3
void zz(int x[N][N])
{ int i,j,t;
for(i=0;i for(j=0;j{ t=x[i][j]; x[i][j]=x[j][i]; x[j][i]=t; }
}
void main()
{ int str[N][N]={1,2,3,4,5,6,7,8,9}, i,j;
zz(str);
for(i=0;i { for(j=0;j printf("\n") ;
}
} 本题5分
第12题
#include <stdio.h>
int d=1 ;
int fun(int p)
{ static int d=3 ;
d+=p;
printf("%3d" , d) ;
return(d) ;
}
void main( )
{ printf("%3d\n" , fun(2+fun(d))) ;
} 本题5分
第13题
#include <stdio.h>
void main()
{ int a=12, b=5, c=-3 ;
if(a>b)
if(b<0) c=0;
else c++;
printf(“%d\n”,c);
} 本题5分
第14题
#include <stdio.h>
void main()
{ int x=2,y=6;
int j;
for(j=1 ; y>0 ; y -- ) j=j*x;
printf(“j=%d\n”,j);
} 本题5分
第15题
#include <stdio.h>
void main ( )
{ char a[20]= "abcXYZ", c ;
int i, j;
j= strlen(a)-1 ;
for (i=0; j>i; i++,j--)
{ c=*(a+i); *(a+i)=*(a+j); *(a+j)=c; }
puts(a);
} 本题5分
第16题
#include <stdio.h>
void main()
{ char x[]="123456789",*p=x ;
int i=0;
while(*p)
{ if(i%2==0) *p='*’;
p++; i++;
}
puts(x);
} 本题5分
第17题
#include <stdio.h>
void main()
{ int a=5, b=8;
printf(“a=%d b=%d\n”, a,b) ;
a=a+b; b=a-b; a=a-b;
printf(“a=%d b=%d\n”, a,b) ;
} 本题5分
第18题
#include <stdio.h>
void main()
{ int s='3’;
switch(s-'2')
{ case 0 :
case 1 : putchar(s+4);
case 2 : putchar(s+4); break;
case 3 : putchar(s+3);
default : putchar(s+2);
}
} 本题5分
第19题
#include <stdio.h>
void main()
{ int x,y;
for(y=1,x=1; y<=20;y++)
{ if(x>=8) break;
if(x%2==1){ x+=5; continue ; }
x-=3;
}
printf(“x=%d, y=%d\n”,x ,y);
} 本题5分
第20题
#include <stdio.h>
int a=100,b=200;
void f( )
{ printf(“%d,%d\n”,a,b);
a=1;b=2;
}
void main()
{ int a=5,b=7 ;
f( );
printf(“%d,%d\n”, a,b) ;
} 本题5分
第11题
#include <stdio.h>
#define N 3
void zz(int x[N][N])
{ int i,j,t;
for(i=0;i
}
void main()
{ int str[N][N]={1,2,3,4,5,6,7,8,9}, i,j;
zz(str);
for(i=0;i
}
} 本题5分
第12题
#include <stdio.h>
int d=1 ;
int fun(int p)
{ static int d=3 ;
d+=p;
printf("%3d" , d) ;
return(d) ;
}
void main( )
{ printf("%3d\n" , fun(2+fun(d))) ;
} 本题5分
第13题
#include <stdio.h>
void main()
{ int a=12, b=5, c=-3 ;
if(a>b)
if(b<0) c=0;
else c++;
printf(“%d\n”,c);
} 本题5分
第14题
#include <stdio.h>
void main()
{ int x=2,y=6;
int j;
for(j=1 ; y>0 ; y -- ) j=j*x;
printf(“j=%d\n”,j);
} 本题5分
第15题
#include <stdio.h>
void main ( )
{ char a[20]= "abcXYZ", c ;
int i, j;
j= strlen(a)-1 ;
for (i=0; j>i; i++,j--)
{ c=*(a+i); *(a+i)=*(a+j); *(a+j)=c; }
puts(a);
} 本题5分
第16题
#include <stdio.h>
void main()
{ char x[]="123456789",*p=x ;
int i=0;
while(*p)
{ if(i%2==0) *p='*’;
p++; i++;
}
puts(x);
} 本题5分
第17题
#include <stdio.h>
void main()
{ int a=5, b=8;
printf(“a=%d b=%d\n”, a,b) ;
a=a+b; b=a-b; a=a-b;
printf(“a=%d b=%d\n”, a,b) ;
} 本题5分
第18题
#include <stdio.h>
void main()
{ int s='3’;
switch(s-'2')
{ case 0 :
case 1 : putchar(s+4);
case 2 : putchar(s+4); break;
case 3 : putchar(s+3);
default : putchar(s+2);
}
} 本题5分
第19题
#include <stdio.h>
void main()
{ int x,y;
for(y=1,x=1; y<=20;y++)
{ if(x>=8) break;
if(x%2==1){ x+=5; continue ; }
x-=3;
}
printf(“x=%d, y=%d\n”,x ,y);
} 本题5分
第20题
#include <stdio.h>
int a=100,b=200;
void f( )
{ printf(“%d,%d\n”,a,b);
a=1;b=2;
}
void main()
{ int a=5,b=7 ;
f( );
printf(“%d,%d\n”, a,b) ;
} 本题5分
答案仅供参考:
11、
1 4 7
2 5 8
3 6 9
12、4 10 10
13、 -2
14、 420
15、 ZYXcba
16、 *2*4*6*8*
17、
5 8
8 5
18、 7 7
19、8
20、 5 7
c语言很难的说.不过学通了也就是了.要多练.答案仅供参考.
11、
1 4 7
2 5 8
3 6 9
12、4 10 10
13、 -2
14、 420
15、 ZYXcba
16、 *2*4*6*8*
17、
5 8
8 5
18、 7 7
19、8
20、 5 7
c语言很难的说.不过学通了也就是了.要多练.答案仅供参考.
这些都要填什么空啊第11题 #include <stdio.h>#define N 3void zz(int x[N][
#include"stdio.h" #define MA(x) x*(x-1) void main() { int a=
#include"stdio.h" void main() { int n=1; printf("%d,%d,%d\n"
英语翻译include "stdio.h"void main (){int i,j,k,n;printf("'water
求此题解题过程:#include #define N 8 void fun(int *x,int i) {*x=*(x+
#include "stdio.h" #include "conio.h" struct n {int x,y;} d[
#include <stdio.h> void main() { int a=1,b=3,c=5,d=4,x=3; if
C语言编程数位的调换#include<stdio.h>int main(void){\x05int n,m,
一道C习题,题是这样的# include "stdio.h"void main(){int i,j,m,n;i=8;j=
#include"stdio.h"main(){int a=-1 printf("%d,%u,%o,%x\n",a,a,
#include "stdio.h"void main(){int x=3,y=5; if (x=y-4) printf
英语翻译.#include"stdio.h" void main() { int i,s=0,x[20]={1,2,3,