知识库

C++语言开发示例:02. 定义变量

2025-02-01 20:10:24 李腾 1 次阅读

carrot.cpp

#include <iostream>

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

    carrots = 25;
    cout << "I have ";
    cout << carrots;
    cout << " carrots.";
    cout << endl;
    carrots = carrots - 1;
    cout << "Crunch, crunch. Now I have " << carrots << " carrots." << endl;
}
转载请注明转自www.hylab.cn,原文地址:C++语言开发示例:02. 定义变量

评论 (0)

登录后发表评论

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