功能:找出一批正整数中的最大的偶数。
#include <stdio.h>
void wwjt();
int fun(int a[],int n)
{
/**********Program**********/
/********** End **********/
}
main()
{
int a[]={1,2,9,24,35,18},k;
k=fun(a,6);
printf("max=%d\n",k);
wwjt();
}
void wwjt()
{
FILE *IN,*OUT;
int iIN[10],iOUT,i,j;
IN=fopen("28.IN","r");
if(IN==NULL)
{
printf("Please Verify The Currernt Dir..it May Be Changed");
}
OUT=fopen("28.out","w");
if(OUT==NULL)
{
printf("Please Verify The Current Dir.. it May Be Changed");
}
for(j=0;j<10;j++)
{
for(i=0;i<10;i++)
fscanf(IN,"%d",&iIN[i]);
iOUT=fun(iIN,10);
fprintf(OUT,"%d\n",iOUT);
}
fclose(IN);
fclose(OUT);
}
登录后提交答案