写出下面程序的执行结果:#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;}
通过键盘输入:Type \t字符串后,请写出下面程序的执行结果:#include #include using namespace std;int main() { string line;getline(cin, line, 't'); cout << line << endl;return 0;}
写出下面程序的执行结果:#include #include #include using namespace std;struct SalaryInfo {unsigned id;double salary;};int main() {SalaryInfo employee1 = { 600001, 8000 };ofstream os("payroll", ios_base::out | ios_base::binary);os.write(reinterpret_cast(&employee1), sizeof(employee1));os.close();ifstream is("payroll", ios_base::in | ios_base::binary);if (is) {SalaryInfo employee2;is.read(reinterpret_cast(&employee2), sizeof(employee2));cout << employee2.id << " " << employee2.salary << endl;} else {cout << "ERROR: Cannot open file 'payroll'." << endl;}is.close();return 0;}
素有“清凉佛国”之称的是( )。
A. 天台山
B. 普陀山
C. 崂山
D. 五台山