作业让在 C++ or c 中编写一个"单一赋值格式"的程序, 即变量一经赋值后,就不能改变, 如对其再次赋值, 回车后, 屏幕会显示Error信息.
如下:
> x = 12
> y= 15.3
> x = y + 3
> Error! The variable ‘x’ has already been assigned with a value.
> y = 20.1
> Error! The variable ‘’y" has already been assigned with a value.
不知道该如何实现, 大家帮帮忙.
万分感谢!!!!!!