李成石

导航

 

编译工具安装

安装gcc,用于编译c程序,使用g++ 用于编译c++

yum install -y gcc

yum install -y gcc-c++

第一个程序:

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

cout<<"enter two number for add:"<<endl;
int a=0, b=0;
cin>>a>>b;
cout<<"the number:"<< a << "add"<<b << "is"<<a+b<<endl;
return 0;
}

 g++ -o print print.c 将print.c 编译为print

执行print ./print

 

posted on 2018-10-25 01:04  李成石  阅读(110)  评论(0编辑  收藏  举报