main.c(31) : fatal error C1004: unexpected end of file found(这是咋回事?)

Bill_Kwok 2020-01-14 12:40:58
# include <stdio.h>
# include <math.h>
float f(float x){
return(x*x*x-5*x*x+16*x-80);
}
float xpoint(float x1,float x2){
float x;
x = (x1*f(x2)-x2*f(x1))/(f(x2)-f(x1));
return x;
}
int main()
{
float x1, x2, y1, y2, x, y;
int count = 0;
do {
printf("Please enter x1 and x2:\n");
scanf("%f%f", &x1,&x2);
y1 = f(x1);
y2 = f(x2);
while(y1*y2>0);
do {
x = xpoint(x1,x2);
y = f(x);
if(y*y1>0) x1=x;
else x2=x;
count++;
} while (fabs(y)>0.000001);
printf("x=%f count=%d",x,count);
return 0;
}
...全文
114 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
寻开心 2020-01-14
  • 打赏
  • 举报
回复
写代码的时候,好好按照规律缩进排版, 这种不匹配的地方就很容易看出来。
第一个while前面少了一个 }

Italink 2020-01-14
  • 打赏
  • 举报
回复
你的do while是怎么写的?根本不匹配
笔记本的风扇控制 ---------------------------------------- 09 November 2006. Summary of changes for version 20061109: 1) ACPI CA Core Subsystem: Optimized the Load ASL operator in the case where the source operand is an operation region. Simply map the operation region memory, instead of performing a bytewise read. (Region must be of type SystemMemory, see below.) Fixed the Load ASL operator for the case where the source operand is a region field. A buffer object is also allowed as the source operand. BZ 480 Fixed a problem where the Load ASL operator allowed the source operand to be an operation region of any type. It is now restricted to regions of type SystemMemory, as per the ACPI specification. BZ 481 Additional cleanup and optimizations for the new Table Manager code. AcpiEnable will now fail if all of the required ACPI tables are not loaded (FADT, FACS, DSDT). BZ 477 Added #pragma pack(8/4) to acobject.h to ensure that the structures in this header are always compiled as aligned. The ACPI_OPERAND_OBJECT has been manually optimized to be aligned and will not work if it is byte-packed. Example Code and Data Size: These are the sizes for the OS- independent acpica.lib produced by the Microsoft Visual C++ 6.0 32- bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. Previous Release: Non-Debug Version: 78.1K Code, 17.1K Data, 95.2K Total Debug Version: 155.4K Code, 63.1K Data, 218.5K Total Current Release: Non-Debug Version: 77.9K Code, 17.0K Data, 94.9K Total Debug Version: 155.2K Code, 63.1K Data, 218.3K Total 2) iASL Compiler/Disassembler and Tools: Fixed a problem where the presence of the _OSI predefined control method within complex expressions could cause an internal compiler error. AcpiExec: Implemented full region support for multiple address spaces. SpaceId is now part of the REGION object. BZ 429 ---------------------------------------- 11 Oc

69,373

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧