首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

哪出错啊求指教啊写了解决办法

2012-05-24 
哪出错啊,求指教啊,写了/* Note:Your choice is C IDE */#include stdio.hvoid main(){int x,y,temppri

哪出错啊,求指教啊,写了
/* Note:Your choice is C IDE */
#include "stdio.h"
void main()
{
  int x,y,temp;
  printf("输入两个数:\n");
  scanf("%d %d",&x&y);
  printf("比较大小:\n");
  printf("x=%d,y=%d",x,y);
  if(x<y)
  {
  temp=x;
  x=y;
  temp=y;
  }
  printf("比较后大小:");
  printf("x=%d,y=%d\n",x,y);
}

[解决办法]
#include "stdio.h"
void main()
{
int x,y,temp;
printf("输入两个数:\n");
scanf("%d %d",&x&y);//差一个逗号哦scanf("%d %d",&x,&y)
printf("比较大小:\n");
printf("x=%d,y=%d",x,y);
if(x<y)
{
temp=x;
x=y;
temp=y;
}
printf("比较后大小:");
printf("x=%d,y=%d\n",x,y);
}
[解决办法]

C/C++ code
#include "stdio.h"void main(){  int x,y,temp;  printf("输入两个数:\n");  scanf("%d %d",&x,&y);  printf("比较大小:\n");  printf("x=%d,y=%d",x,y);  if(x<y)  {  temp=x;  x=y;  y=temp;  }  printf("比较后大小:");  printf("x=%d,y=%d\n",x,y);}
[解决办法]
C/C++ code
#include "stdio.h"void main(){  int x,y,temp;  printf("输入两个数:\n");  scanf("%d %d",&x,&y);  printf("比较大小:\n");  printf("x=%d,y=%d",x,y);  if(x<y)  {  temp = x;  x = y;  y = temp;  }  printf("比较后大小:");  printf("x=%d,y=%d\n",x,y);} 

热点排行