#include "stdafx.h"
#include
//#include
#include
using namespace std;
int main()
{
int i=0;
int iNum1=0, iNum2=0;
while(1)
{
std:cout << "這是第一個程序" << endl;
cout << "請輸入i值" << endl;
cin >> hex>>i;
cout << "請輸入2個要求和的整數:"<< endl;
cin >>iNum1;
cin >>iNum2;
/*
cout << iNum1<<endl;
cout << "+"<<endl;
cout << iNum2<<endl;
cout << "=" <<endl;
cout << iNum1+iNum2 <<endl;
*/
cout << "i=" << i<<endl;
cout << iNum1<< "+"<<iNum2<< "=" << iNum1+iNum2 <<endl;
cout <<"hex\t"<< "i=" <<hex<< i<<endl;
cout <<"Oct\t"<< "i=" <<oct<< i<<endl;
cout <<"Dec\t"<< "i=" <<dec<< i<<endl;
}
return 0;
}
是std::不是std:。。。。既然你在全局名稱空間中使用了using namespace std;那麼就沒必要對cout使用這個限定符了