正在加载图片...
23C++在非面向对象方面的扩充 231注释与续行 以下两条语句是等价的: x-y+z; /* This is a comment * x-y+z //This is a comment / 7 75 7372 3 75;:kk;kκk;κkkκκκ☆ This program adds two integers that are entered by us, then writes the sum to scre #include<iostream.h> void main( int xvzs x、y、 zare integer cout<<"Pleaseinput two integers: cin> /enter x,y cout<< <endl; //writes x, y to screen FX+y; cout<< x+y rendl //writes the sum to screen2.3 C++在非面向对象方面的扩充 2.3.1 注释与续行 以下两条语句是等价的: x=y+z; /* This is a comment */ x=y+z; //This is a comment /*********************************** This program adds two integers that are entered by us, then writes the sum to screen ***********************************/ #include<iostream.h> void main() { int x,y,z; //x、y、z are integer cout<<″Please input two integers:″; cin>>x>>y; //enter x,y cout<<″x=″<<x<<″y=″<<y<<endl; //writes x,y to screen z=x+y; cout<<″x+y=″<<z<<endl; //writes the sum to screen }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有