我自己写的代码是:
1 #include <iostream> 2 #include "Sales_item.h" 3 4 int main() 5 { 6 Sales_item A, B; 7 while (std::cin >> B) 8 A += B; 9 std::cout << "Sum is: " << A << std::endl; 10 11 return 0; 12 13 }
结果运行时发生了问题
采用的是文件结束符进行结束输出,结果输出结果中并不包含ISBN号
原文:https://www.cnblogs.com/yinxun/p/14164889.html