// 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'
帮我看看该怎么办
#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;
}
可以运行了
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后面少了个闭合的"。
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息