[此贴子已经被作者于2007-5-22 23:30:15编辑过]
#include<stdio.h>void f(int x,int y);void main()
{ int a,b; scanf("%d,%d",&a,&b); f(a,b);}void f(int x,int y){ int c; c=x;x=y;y=c; printf("%d,%d",x,y);}这样就可以了,你试试
#include<stdio.h>void main(){ int a,b; scanf("%d,%d",&a,&b); f(a,b);
}int f(int x,int y){ int c; c=x;x=y;y=c; printf("%d,%d,",x,y);}用指针更容易
}int f(int x,int y){ int c; c=x;x=y;y=c; printf("%d,%d,",x,y);}
看到大家都这么热情地帮忙,心里真的很高兴
25楼的代码有误,函数定义为整型时,需要返回值的~~