鱼C论坛

 找回密码
 立即注册
查看: 1790|回复: 1

这个是我在书上抄的,对过后没发现错的但是不能运行

[复制链接]
发表于 2016-1-5 22:54:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
显示的是
  1. --------------------Configuration: one - Win32 Debug--------------------
  2. Compiling...
  3. one.c
  4. D:\C语言\MSDev98\MyProjects\one\one.c(12) : error C2065: 'FebSold' : undeclared identifier
  5. D:\C语言\MSDev98\MyProjects\one\one.c(12) : error C2065: 'MarSold' : undeclared identifier
  6. 执行 cl.exe 时出错.

  7. one.obj - 1 error(s), 0 warning(s)
复制代码

代码是:
  1. #include <stdio.h>

  2. int main(void)
  3. {
  4.         const float Revenue_Per_150 = 4.5f;
  5.         short JanSold = 23500;                                                        // Stock sold in January
  6.         short FebSlod = 19300;                                                        // Stock sold in February
  7.         short MarSlod = 21600;                                                        // Stock sold in March
  8.         float RevQuarter = 0.0f;                        // Sales for the quarter

  9.         short QuarterSold = JanSold + FebSold + MarSold;        // Calculate quarterly total

  10.         // Output minthly sales and total for the quarter
  11.         printf("Stock sold in\nJan:%d\nFeb:%d\n",JanSold,FebSold,MarSold);
  12.         printf("Total stock sold in first quarter:%d\n",QuarterSold);
  13.        
  14.         // Calculate the total recenue for the quarter and output it
  15.         printf("Sales recenue this quarter is:$%.2f\n",RevQuarter);
  16.         return 0;
  17. }
复制代码

希望的得到求解,谢谢
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2016-1-6 19:15:42 | 显示全部楼层
FebSold 写成了 FebSlod,MarSold 写成了 MarSlod
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-21 17:40

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表