我是大菜鸟,请帮帮忙!!!

来源:百度知道 编辑:UC知道 时间:2024/05/26 23:59:21
#include <stdio.h>
void main()
{
float x;
int x_sure=1;
char ch;
while (x_sure==1)
{
int input_x=1;
printf ("ÇëÊäÈëxÖµ\n");
scanf ("%f",&x);
printf ("xֵΪ%f,È·¶¨Âð?(Y/N)\n",x);

while (input_x==1)
{
input_x=0;
scanf ("%c",&ch);
if((x_char=='Y')||(x_char=='y'))
{
x_sure=0;
}
else if((x_char=='N')||(x_char=='n'))
{
x_sure=1;
}
else
{
input_x=1;
printf("ÊäÈëµÄÈ·¶¨×ÖĸÓÐÎó£¡ÖØÐÂÈ·¶¨£¨Y/N£©£º\n");
}

}

}
printf ("

ÊäÈëµÄÈ·¶¨×ÖĸÓÐÎó£¡ÖØÐÂÈ·¶¨£¨Y/N£©£º
这都是什么
是不是编码错误啊,而且编译不过,没有x_char的声明

#include <stdio.h>
void main()
{
float x;
int x_sure=1;
char ch;
while (x_sure==1)
{
int input_x=1;
printf ("??ê?è?x?μ\n");
scanf ("%f",&x);
printf ("x?μ?a%f,è·?¨?e?(Y/N)\n",x);

while (input_x==1)
{
input_x=0;
scanf ("%c",&ch);
if((ch=='Y')||(ch=='y'))
{
x_sure=0;
}
else if((ch=='N')||(ch=='n'))
{
x_sure=1;
}
else
{
input_x=1;
printf("ê?è?μ?è·?¨×???óD?ó£???D?è·?¨£¨Y/N£?£o\n");
}

}

}
printf ("x=%f",x);
}

这回试试

顶上面的回答