您的位置:首页 > 编程语言 > C语言/C++

杨亦涛老师分享计算机C++基础教学

2020-10-14 19:34 1046 查看

编写第一个计算机程序语言,让计算机开口说话

#include<iostream>

using namespace std;
int main()
{
cout<<"欢迎来您来到程序世界"<<endl;
}

完成作业:

自我介绍

姓名:杨亦涛

学校:杨老师课堂
社团:计算机社团
时间:2020-09-23

#include<iostream>
using namespace std;
int main()
{

int a,b,c;
a=3;
b=4;
c=a+b;
cout<<"c="<<c;
}

int (整数)

cout (输出)

end(结束,结尾)

买电影票作业

一位同学请其他朋友看电影,已知其中电影票是50元1张,小朋友一共有X人,需要支付对多少钱?
#include<iostream>
using namespace std;
int main()
{

int x,y;
cout<<"input x=";
cin>>x;
y=50*x;
cout<<"y="<<y;
}

input 输入

cin 该操作符是根据后面变量的类型读取数据

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: