关键词 看书
A学习基础内容
B编写一个代码 一个简单赋值后加上2后的源代码
#include <iostream>
int main ()
{
using namespace std ;
int carrots;
cout<<"how many carrots do you have? " << endl ;
cin >>carrots ;
cout<<"here are two more ";
carrots = carrots+2;
cout<<"now you have "<<carrots<<"carrots. "<<endl;
return 0;
}
C以下是我自己的理解
int 表示输入的类型 cout 后 表示显示的内容
cin 输入 {} 指函数内容