高手请进,小弟有事请教#includeint sum(int);int f(int);void main(){int a,b;printf("enter a integer:");scanf("%d",&a);b=sum(a);printf("a=%d,b=%d\n",a,b);}int sum(int n){int a,b=0,c=0;for(a=0;a

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/29 00:18:57
高手请进,小弟有事请教#includeintsum(int);intf(int);voidmain(){inta,b;printf("enterainteger:");scanf("%d",&a

高手请进,小弟有事请教#includeint sum(int);int f(int);void main(){int a,b;printf("enter a integer:");scanf("%d",&a);b=sum(a);printf("a=%d,b=%d\n",a,b);}int sum(int n){int a,b=0,c=0;for(a=0;a
高手请进,小弟有事请教
#include
int sum(int);
int f(int);
void main()
{
int a,b;
printf("enter a integer:");
scanf("%d",&a);
b=sum(a);
printf("a=%d,b=%d\n",a,b);
}
int sum(int n)
{
int a,b=0,c=0;
for(a=0;a

高手请进,小弟有事请教#includeint sum(int);int f(int);void main(){int a,b;printf("enter a integer:");scanf("%d",&a);b=sum(a);printf("a=%d,b=%d\n",a,b);}int sum(int n){int a,b=0,c=0;for(a=0;a
#include<stdio.h>
int f(int a)
{
  int b;
  b=a*a+1;
  return b;
}
int sum(int n)
{
  int a,b=0,c=0;
  for(a=0;a<=n;a++)
    b=b+f(a);
  return b;
}
void main()
{
  int a,b;
  printf("enter a integer:");
  scanf("%d",&a);
  b=sum(a);
  printf("a=%d,b=%d\n",a,b);
}
这样试试