c程序员面试题

来源:百度知道 编辑:UC知道 时间:2024/06/28 07:49:01
一道难题。面试题
#include <iostream.h>
void main()
{
( )int n =5;
int & ( )int ref = n;
ref=ref+n;
cout<<ref<<n;
}要求,输入结果为105
填空题,两个const是错的,题不会那么简单的哟,要调试过再说,别说无聊的回答

又没限制括号里的内容,那就随便写呗
(int m;) int n =5;
int& (refm = m;) int ref = n;
ref=ref+n;
cout<<ref<<n;

#include <iostream.h>
void main()
{
const int n =5;
int ref = n;
ref=ref+n;
cout<<ref<<n<<endl;
}

;; int n =5;
int &b=n; int ref = n;
ref=ref+n;
cout<<ref<<n;