写出下面程序的执行结果:#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;}
写出下面程序的执行结果:#include #include #include using namespace std;int main() {double values[] = { 1.23, 35.36};string names[] = { "Zoot", "Jimmy"};cout<
写出下面程序的执行结果:#include #include #include using namespace std;template inline string toString(const T &v) {ostringstream os;os << v;return os.str();}int main() {string str1 = toString(5);cout << str1 << endl;string str2 = toString(1.2);cout << str2 << endl;return 0;}