这个程序不知道那里错了,求高手帮忙啊
main(){
int a,b,c,d,e;
a=8512,b=1369,c=3254,d=8795;
sum(a,b,c,d,e);
printf("%d+%d+%d+%d=%d\n",a,b,c,d,e);
}
sum(p,q,r,s,t)
int *p,*q,*r,*s,*t;
{
*t=*p+*q+*r+*s;
return(*t);
}
程序代码:#include <stdio.h>
int sum(int *p,int *q,int *r,int *s,int *t);
int main()
{
int a,b,c,d,e;
a=8512,b=1369,c=3254,d=8795;
sum(&a,&b,&c,&d,&e);
printf("%d+%d+%d+%d=%d\n",a,b,c,d,e);
return 0;
}
int sum(int *p,int *q,int *r,int *s,int *t)
{
*t=*p+*q+*r+*s;
return(*t);
} 第一个程序可以改成这样,你那个sum函数的定义方式很久以前已经不用了,代码太老了。。。。
程序代码:#include <stdio.h>
static char a[]="tianjin";
void p1()
{
printf("%s is one of the biggest city",a);
return;
}
void p2()
{
printf("in the world.\n");
return;
}
int main()
{
printf("%s is one city in China.\n",a);
p1();
p2();
return 0;
}第二个程序也函数定义方式太老了,新的编译器大多不认识了。。。