我有以下代码:
#include <QCoreApplication>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int salary;
int childeren;
cout << "please type base salary=";
cin>> salary >> endl;
cout<< "plz type count your childeren=";
cin >> childeren >> endl ;
int Totalsalary=salary + childeren*10;
cout<< Totalsalary<< endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我试图理解创建错误:
'operator>>' 不匹配(操作数类型是 'std::basic_istream::__istream_type {aka std::basic_istream}' 和 '')cin>>salary >> endl; ^
c++ ×1