大家好,这是我的代码,我只是帮助我设法纠正了前3个问题,但其余的我仍然遇到错误。
以下是所有问题:
使用语句完成提供的main()
程序以完成以下各项操作。在每种情况下,必须使用适当的I / O流操纵器尽可能产生适当的输出。
到目前为止,这是我的代码:
#include <iostream>
#include <iomanip>
using namespace std;
int
main0()
{
bool first;
int second;
long third;
float fourth;
float fifth;
double sixth;
cout << "Enter bool, int, long, float, float, and double values: ";
cin >> first >> second >> third >> fourth >> fifth >> sixth;
cout << endl;
cout << noboolalpha << first;
cout << " ";
cout << boolalpha << first << endl;
cout <<left << dec << showbase;
cout << second;
cout << " ";
cout << internal << hex << showbase;
cout << second;
cout << " ";
cout <<right << oct <<showbase;
cout << second << endl;
cout << third<< scientific<< endl;
cout <<left << setw(4)<<fixed<< fourth <<endl;
cout <<setprecision(4)<< fourth <<endl;
cout <<left<<setw(7)<< fifth << endl;
cout <<right<<setprecision(3)<< fifth;
cout <<third<<endl;
cout <<right<<setw(2)<<fourth<<endl;
cout << fixed<<sixth<< endl;
cout << right << fixed<<setprecision(8)<< fourth<< endl;
cout <<left<<showpoint <<setprecision(6)<<sixth;
// ***** Solution ends here ****
cin.get();
return 0;
}
答案 0 :(得分:0)
我回答4-6:
{{1}}
祝其他人好运。