永发信息网

C语言提问// a.cpp : Defines the entry point for the console application.

答案:2  悬赏:60  手机版
解决时间 2021-06-04 14:13
  • 提问者网友:刺鸟
  • 2021-06-03 20:28

// a.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
int main()
{
int number,received,sold,count;
float Iventory,Newbalance;
count=1;
while(count<=3);
{
printf("Type in Bodentifok identification number,Iventory balance at the beginning of the month,Number of copies during the month,Number of copies sold during the month:);
scanf("%d%f%d%d",&number,&Iventory,&received,&sold);
Newbalance=Iventory+received-sold;
printf("Book identification number is%d,New Balance is%d",number,Newbalance);
count++;
}
return 0;
}


C:\Program Files\Microsoft Visual Studio\MyProjects\a\a.cpp(14) : error C2001: newline in constant
C:\Program Files\Microsoft Visual Studio\MyProjects\a\a.cpp(15) : error C2146: syntax error : missing ')' before identifier 'scanf'

帮我看看该怎么办

最佳答案
  • 五星知识达人网友:酒者煙囻
  • 2021-06-03 22:06

#include "stdio.h"
int main()
{
int number,received,sold,count;
float Iventory,Newbalance;
count=1;
while(count<=3);
{
printf("Type in Bodentifok identification number,Iventory balance at the beginning of the month,Number of copies during the month,Number of copies sold during the month:");
scanf("%d%f%d%d",&number,&Iventory,&received,&sold);
Newbalance=Iventory+received-sold;
printf("Book identification number is%d,New Balance is%d",number,Newbalance);
count++;
}
return 0;
}


可以运行了

全部回答
  • 1楼网友:长青诗
  • 2021-06-03 23:27

printf("Type in Bodentifok identification number,Iventory balance at the beginning of the month,Number of copies during the month,Number of copies sold during the month:);

==>

printf("Type in Bodentifok identification number,Iventory balance at the beginning of the month,Number of copies during the month,Number of copies sold during the month:");

应该是month后面少了个闭合的"。

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯