当前位置:首页 > 83课趣味CPP > 正文

第3课时-古诗鉴赏-cout语句

#include<iostream>
using namespace std;
int main()
{
  cout<<"春眠不觉晓,处处蚊子咬。";
  return 0;
}

输入和输出是用“流”的方式实现的。


cout<<

将输出流的内容输出到设备上。

(一般指标准输出设备:显示器)


编程提示

双引号和分号,都是英文符号,不是中文符号。

各输入法切换:Ctrl+Shift

中英文切换:Ctrl+空格

#include<iostream>
using namespace std;
int main()
{
  cout<<"春 晓"<<endl; 
  cout<<"春眠不觉晓,"<<endl;
  cout<<"处处蚊子咬。"<<endl;
  cout<<"夜来嗡嗡声,"<<endl;
  cout<<"脓包知多少。"<<endl;
  return 0;
}

把标点符号写错,

造成程序语法错误,

是初学者最易犯的毛病

(没有之一)。


include  包含,包括

iostream  输入输出流

using  使用

namespace  命名空间

std  standard的缩写,标准的

cout  输出流

endl  end line的缩写,换行


更新时间 2025-09-09