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

2024-07-13 16:12:49 2025-02-01 20:26:27 李腾 26 次阅读 0 次点赞

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;
}
本文由人工编写,AI优化,请仔细甄别,转载请注明转自www.hylab.cn,原文地址:C++语言开发示例:12. 表达式

评论 (0)

登录后发表评论

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