您的位置:首页 > 其它

cout<<endl;什么意思?

2016-06-23 10:52 1626 查看
cout是c++语言的输出符号。endl是程序的结束符。

cout<<endl是使程序输出结束。

1.程序实例

int a=2;

int c=3;

int b=(a>c)?2:3;

cout<<"b:"<<b<<endl;

这样的结果是b为3
cout<<"z:"<<z<<endl; //输出 z:   2
// cout 相当于 printf();是输出函数
cout<<"z:"<<z<<endl; <=> printf("z:%d\n",z);
z=a>b?a:a>b?a:b;的意思是  从左往右 ,a>b?a:a>b... 1>2?a:a>b ...=>a>b....
=>a>b?a:b =>1>2?1:2 =>z=2
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: