调试下列程序 写出输出结果 并解释输出结果 #include <iostream> using namespace std; in
已帮助 人
调试下列程序,写出输出结果,并解释输出结果 #include <iostream> using namespace std; int main() { void fun(int, int&); int a, b; fun(2, a); fun(3, b); cout << "a + b = " << a + b << endl; return 0; } void fun(int m, int &n) { n = m + 4; }

回答
共1条回复-
GFEDCB。 开始指针cp指向字符串结束标志,在循环中,cp依次向前移动,当打印出第二个字符后,cp指向第一个字符,循环判断条件不满足,退出循环,因此,只打印出第一个字符以后的字符的逆序列。
