国家二级 C 语言机试(操作题)模拟试卷 354(无答案)一、程序填空题1 用筛选法可得到 2n (nint fun (int n) int a10000 ,i,j, count=0 ;i = 2;while (i#includevoid fun (int a,int *b,int *c) int i,j ,d,y;for (i=3;idouble fun (int n)NONO()/*请在此函数内打开文件,输入测试数据,调用 fun 函数,输出数据,关闭文件。*/FILE *rf,*wf; int n,i ; double s;rf fopen(“indat“,“r“) ;wf=fopen “outdat“,“w“) ;for(i = 0 ; i 10 ; i+) fscanf (rf, “ d“, &n);s = fun (n);fprintf (wf, “1fn“ , s);fclose (rf); fclose (wf);main()int n; double s ;printf(“nlnput n: ”);scanf(“d“, &n);s=fun (n);printf (“nns=fn“ ,s);NONO();