#include <stdio.h>
#include <math.h>
void fun(double a[],double x,int n)
{
/**/
/**/
}
main()
{
int n;
double a[2],x;
printf(“\nPlease enter x,n:”);
scanf(“%lf,%d”,&x,&n);
while(x<1.0 || x>2.0 || n<0 || n>10)
{ printf(“\nInvalid data (1.0<=x<=2.0,0<n<=10)\n\nPlease enter x,n:”);
scanf(“%lf,%d”,&x,&n);
}
fun(a,x,n);
printf(“\nResult: a[0]=%f,a[1]=%f”,a[0],a[1]);
getch();
}
/*fun(x)=(2n+1)*x^n/n(n+1) 并将结果存入a[0] 将小数部分存入a[1]*/
>> 本文固定链接: http://www.vcgood.com/archives/2431