(第二课)c++语句

时间:2021-04-20 14:29:02   收藏:0   阅读:0
#include <iostream>               //预处理器编译指令#include
int main(void)                    //函数头 
{                                 //函数体开始{
    using namespace std;          //编译指令
    int apple;                    //声明整数变量
    apple = 25;                   //赋值变量
    cout << "我有";               
    cout << apple;
    cout << "个苹果";
    cout << endl;                 //换行 C语言使用\n换行
    apple = apple - 1;            //减法运算
    cout << "吃了一个,现在还有" << apple << "个苹果" << endl;
    return 0;                     //函数返回0
}                                 //函数体结束}

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!