以下程序通过函数SunFun()调用F(x),x的值从0到10,这里F(x)=x2+1,由F函数实现,请填空。 #include <stdio. h> int SunFun(int); int F(int);

admin2009-01-15  33

问题 以下程序通过函数SunFun()调用F(x),x的值从0到10,这里F(x)=x2+1,由F函数实现,请填空。
      #include <stdio. h>
      int SunFun(int);
      int F(int);
      main ( )
       {  pfintf( "The sum = % d \n" ,SunFun(10) ); }
      SunFun( int n)
      {   int x,s =0;
           for(x=0; x<=n; x++) s+ =F(【  】);
           return s;
      F( int x)
      {  return (【  】);}

选项

答案x x * x+1

解析 本题考查函数的调用。P(x)的含义为x的平方加1,所以第一处应填x;第二处应填x*x+1。
转载请注明原文地址:https://jikaoti.com/ti/ZHK0FFFM
0

相关试题推荐
最新回复(0)