知识库

C++语言开发示例:12. 表达式

2025-02-01 20:26:27 李腾 1 次阅读

express.cpp

#include <iostream>

int main()
{
    using namespace std;
    int x;

    cout << "The expression x = 100 has the value ";
    cout << (x = 100) << endl;
    cout << "Now x = " << x << endl;
    cout << "The expression x < 3 has the value ";
    cout << (x < 3) << endl;
    cout << "The expression x > 3 has the value ";
    cout << (x > 3) << endl;
    cout.setf(ios_base::boolalpha);
    cout << "The expression x < 3 has the value ";
    cout << (x < 3) << endl;
    cout << "The expression x > 3 has the value ";
    cout << (x > 3) << endl;
}
转载请注明转自www.hylab.cn,原文地址:C++语言开发示例:12. 表达式

评论 (0)

登录后发表评论

暂无评论,快来发表第一条评论吧!