0$房天下问答|阅读程序(或片断),写出输出结果:$https://m.fang.com/ask/ask_1849880.html$https://static.soufunimg.com/common_m/m_public/201511/images/asksharedefault.png
packc/pages/ask/detail/detail?askid=1849880
-
阅读程序(或片断),写出输出结果:
1. cout << ( 8*5*2+3 ) / 2+4;2. 31 % 7 +23. int x = 3;while ( x <= 6 ) {x++;cout << “x 的值是: “ << x << endl;}cout << “x 最终的值是: “ << x << endl;4. for ( int i = 1; i<=6; i++ ) {switch (i) {case 1:cout << “x 的值是1\n”; break;case 4:cout << “x 的值是4\n”;case 6:cout << “x 的值是6\n”; break;default:cout << “x 的值不是1,4 也不是6\n”;}}5. void f1() void f2( int x ){ int x = 5; { x += 10;f2(x); cout << x << endl;cout << x << endl; }} 在调用函数f1时,程序段的输出结果是什么?
更多
共1个回答
-
-
-
IP探索者
丨Lv 4
1. cout << ( 8*5*2+3 ) / 2+4; 452. 31 % 7 +2 53. int x = 3; while ( x <= 6 ) { x++; cout << “x 的值是: “ << x << endl; } cout << “x 最终的值是: “ << x << endl; 4 5 6 774. for ( int i = 1; i<=6; i++ ) { switch (i) { case 1: cout << “x 的值是1\n”; break; case 4: cout << “x 的值是4\n”; case 6: cout << “x 的值是6\n”; break; default: cout << “x 的值不是1,4 也不是6\n”; } } x 的值是1x 的值不是1,4 也不是6x 的值不是1,4 也不是6x 的值是4x 的值是6x 的值不是1,4 也不是6x 的值是65. void f1() void f2( int x ) { int x = 5; { x += 10; f2(x); cout << x << endl; cout << x << endl; } } 在调用函数f1时,程序段的输出结果是什么? //本题出题错误,无法回答。建议你查看。
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。

关注成功