C++入门 输出Hello World
#include <iostream>using namespace std;int main(){
cout << "Hello, world!" << endl; return 0;}它等效于
#include <iostream>using namespace std;int main(){
cout << "Hello, world! \n"; return 0;}#include <iostream>using namespace std;int main(){
cout << "Hello, world!" << endl; return 0;}它等效于
#include <iostream>using namespace std;int main(){
cout << "Hello, world! \n"; return 0;}什么是数组呢?顾名思义,一组数,不一定是数,也可以是char类型的字符组(我自己给char类型数组起的名字)怎么创建数组呢?int 数组名[数组成员数]; int a[3];我就创建了一个叫做a的整数数组,数组中包含3个数,我应该怎么修改a数组的值呢?a[0]=1; a[1]...
什么是类和对象?张三找了一个女朋友,她的女朋友就是他的对象。搞笑一下,打个比方,我们都是人类,人类这个类的一个成员(对象)。怎么创建类呢?#include <iostream> using namespace std; class fenshu...
#include<iostream> using namespace std; struct books{ char name[10]; int num; float price; }book; int&nb...