|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
我是一名C++初学者,正在学习小甲鱼老师的C++快速入门系列课程。今天学习一个程序,遇到一个问题。程序如下:
#include <IOSTREAM>
#include <math.h>
using namespace std;
int main()
{
#if(0)
double result = sqrt(3.0);
cout << "对3开根号保留小数点后0~9位,结果如下: \n" << endl;
for( int i=0; i <= 9 ; i++ )
{
cout.precision(i);
cout << result << endl;
}
cout << "当前输出精度为: " << cout.precision() << endl;
#endif
#if(1)
int width = 4;
char str[20];
cout << "输入一段文本: \n";
cin.width(5);
while ( cin >> str )
{
cout.width( width++ );
cout << str << endl;
cin.width(5);
}
#endif
return 0;
}
程序在VC++6.0上运行正常,但是不能对程序结果进行标记和复制!!!
同程序的另一段程序结果可以正常的标记和复制!
请问有没有人知道为什么?
有没有办法让我可以对程序结果进行复制? |
|