![](https://csdnimg.cn/release/download_crawler_static/10272625/bg5.jpg)
int fun( STREC *a,STREC *b,int l, int h )
{
int i,j = 0 ;
for(i = 0 ; i < N ; i++)
if(a[i].s >= l && a[i].s <= h) b[j++] = a[i] ;
return j ;
}
18 funs
ASCII
t
s
"ABCDEFG12345" AASCII
1ASCII
t
"BDF24"
void fun(char *s, char t[])
{
int i, j = 0 ;
for(i = 0 ; i < strlen(s); i++) if(s[i] % 2==0) t[j++] =
s[i] ;
t[j] = 0 ;
}
19 funab
c
:ac
bc
a45b=12c=2415
void fun(int a, int b, long *c)
{
*c = (b%10)*1000+(a/10)*100+(b/10)*10+a%10;
}
20 fun
1 3 5 7 9
2 9 9 9 4
6 9 9 9 8
1 3 5 7 0
61
int fun ( int a[M][N] )
{
int tot = 0, i, j ;
for(i = 0 ; i < N ; i++) {
tot += a[0][i] ;
tot += a[M-1][i] ;
}
for(i = 1 ; i < M - 1 ; i++) {
tot += a[i][0] ;
tot += a[i][N-1] ;
}
return tot ;
}
21 NN
fun,
s
a
|0 1 2 7 9|
|1 9 7 4 5|
a = |2 3 8 3 1|
|4 5 6 8 2|
|5 9 1 4 1|
s: 3.375
double fun ( int w[][N] )
{
int i, j, n=0;
double sum=0;
for ( i =0; i<N; i++ ) {
sum+=w[0][i]+w[N-1][i]; n+=2;
}
for ( i =1; i<N - 1; i++ ) {
sum +=w[i][0]+w[i][N-1];
n+=2;
}
return sum/n;
}
22 fun: