新手,这是为什么

HelloWindow 2015-05-11 07:18:49
int main()
{
using namespace std;

int carrots;

cout << "How many carrots do you have?" << endl;
cin >> carrots; // C++ input
cout << "Here are two more. ";
carrots = carrots + 2;
// the next line concatenates output
cout << "Now you have " << carrots << " carrots." << endl;
return 0;
}

...全文
78 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
HelloWindow 2015-05-11
  • 打赏
  • 举报
回复
字符不也是int么 cout不是智能的么
zth4124 2015-05-11
  • 打赏
  • 举报
回复
carrots是int,怎么能输入字符呢

3,882

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧