C语言 来找错咯~~

来源:百度知道 编辑:UC知道 时间:2024/05/29 14:57:58
#include "stdio.h"
#include "conio.h"
int x,y;
void kj(int,int);
void main()
{
x=1;
y=2;
printf("%d,%d\n",x,y);
kj();
getch();
}
void kj()
{
int temp;
temp=y;
y=x;
x=temp;
printf("%d,%d",x,y);
}

#include "stdio.h"
#include "conio.h"

int x,y;
void kj();//(int,int); 下面的函数实现和定义都没有参数,这里也不应该有参数

void main()
{
x=1;
y=2;
printf("%d,%d\n",x,y);
kj();
getch();
}

void kj()
{
int temp;

temp=y;
y=x;
x=temp;
printf("%d,%d",x,y);
}

#include "stdio.h"
#include "conio.h"
int x,y;
void kj(int,int);
void main()
{

x=1;
y=2;
printf("%d,%d\n",x,y);
kj(x,y); //函数实参缺少
getch();
}
void kj(int,int) //函数形参缺少
{
int temp;
temp=y;
y=x;
x=temp;
printf("%d,%d",x,y);
}