#include <iostream>
using namespace std;
int main(void)
{
int x = 3;
int &y=x;//定义引用,y是x的引用
cout<<"x="<<x<<","<<"y="<<y<<'\n';//打印x和y的值
cout<<"修改y的值";
cin>>y;
cout<<"x="<<x<<","<<"y="<<y<<'\n';//再次打印x和y的值
return 0;
}
using namespace std;
int main(void)
{
int x = 3;
int &y=x;//定义引用,y是x的引用
cout<<"x="<<x<<","<<"y="<<y<<'\n';//打印x和y的值
cout<<"修改y的值";
cin>>y;
cout<<"x="<<x<<","<<"y="<<y<<'\n';//再次打印x和y的值
return 0;
}