carrots.cpp
来自「一本很好的C++学习的丛书!初学者必看的」· C++ 代码 · 共 20 行
CPP
20 行
// carrots.cpp -- food processing program// uses and displays a variable#include <iostream>int main(){ using namespace std; int carrots; // declare an integer variable carrots = 25; // assign a value to the variable cout << "I have "; cout << carrots; // display the value of the variable cout << " carrots."; cout << endl; carrots = carrots - 1; // modify the variable cout << "Crunch, crunch. Now I have " << carrots << " carrots." << endl; return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?