主观?/p>
题目
1
回含
n
个元素的整型数组参数中有几个数能?/p>
3
整除?/p>
#include "stdio.h"
void main()
{
int ct(int a[],int n)
{int t=0,i;
for(i=0;i<n;i++)
if(a[i]%3==0) t++;
return t;}}
题目
2
编写函数
float div(int a, int b)
,以返回
a
除以
b
的结果?/p>
#include "stdio.h"
void main()
{
float div(int a,int b)
{if(b==0) return 1e38f;
return (float)a/b;}}
题目
3
编写函数
fun
计算表达?/p>
x+2y+3z
的值,其中
x
?/p>
y
?/p>
z
为整型参数?/p>
#include "stdio.h"
void main()
{
fun(int x,int y,int z)
{return x+2*y+3*z;}}
题目
4
编写函数
max
,找出含
n
个元素的整型数组参数中的最大值?/p>
#include "stdio.h"
void main()
{int max(int a[],int n)
{int t=a[0],i;
for(i=1;i<n;i++)
if(a[i]>t) t=a[i];
return t;}}
题目
5
编写函数
min
,找出含
n
个元素的整型数组参数中的最小值?/p>
#include "stdio.h"
void main()