C++ 帮忙看下是什么错误?
来源:百度知道 编辑:UC知道 时间:2024/09/21 13:53:06
//hexoct2.cpp -- display values in hex and octal
#include <stdafx.h>
using namespace std;
int main(int argc, char* argv[])
{
using namespace std;
int chest = 42;
int waist = 42;
int inseam = 42;
cout << "Monsieur cuts a striking figure!" << endl;
cout << "chest = " << chest << "(decimal)" <<endl;
cout << hex; // manipulator for changing number base
cout << "waist = " << waist << "hexadecimal" << endl;
cout << oct; // manipulator for changing number base
cout << "inseam = " << inseam << " (octal) " << endl;
return 0;
}
#include <stdafx.h>
using namespace std;
int main(int argc, char* argv[])
{
using namespace std;
int chest = 42;
int waist = 42;
int inseam = 42;
cout << "Monsieur cuts a striking figure!" << endl;
cout << "chest = " << chest << "(decimal)" <<endl;
cout << hex; // manipulator for changing number base
cout << "waist = " << waist << "hexadecimal" << endl;
cout << oct; // manipulator for changing number base
cout << "inseam = " << inseam << " (octal) " << endl;
return 0;
}
#include <iostream.h>
int main(int argc, char* argv[])
{
using namespace std;
int chest = 42;
int waist = 42;
int inseam = 42;
cout << "Monsieur cuts a striking figure!" << endl;
cout << "chest = " << chest << "(decimal)" <<endl;
cout << hex; // manipulator for changing number base
cout << "waist = " << waist << "(hexadecimal)" << endl;
cout << oct; // manipulator for changing number base
cout << "inseam = " << inseam << " (octal) " << endl;
return 0;
}
这样就可以了!呵呵~
#include <iostream>
把这个添加到<stdafx.h>的下面去。
加上
#include <iostream.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
int chest = 42;