写出下面程序的执行结果:#include #include #include using namespace std;int main(){ int x; double a;cout << "x sin(x) cos(x)" << endl; //输出表头for( x=10; x<20; x+=10 ){ a = x * 3.14 / 180; cout << setw(3) << setiosflags( ios::left ); cout << setiosflags( ios::fixed ); cout << setprecision(5); cout << x; cout << setw(10) << sin(a); cout << setw(10) << cos(a)<
写出下面程序的执行结果:#include using namespace std;int main() {double values[] = { 1.23, 35.36};for(int i = 0; i < 2; i++) {cout.width(10);cout << values[i] << endl;}return 0;}
写出下面程序的执行结果:#include #include #include using namespace std;int main() {double values[] = { 1.23, 35.36};string names[] = { "Zoot", "Jimmy"};for (int i = 0; i < 2; i++)cout << setw(6) << names[i] << setw(10) << values[i] << endl;return 0;}
写出下面程序的执行结果:#include #include #include using namespace std;int main() {double values[] = { 1.23, 35.36};string names[] = { "Zoot", "Jimmy"};for (int i=0;i<2;i++)cout << setiosflags(ios_base::left)<< setw(6) << names[i]<< resetiosflags(ios_base::left)<< setw(10) << values[i] << endl;return 0;}