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 { public: int xuehao; int yuwen; }; ...
#include<iostream> using namespace std; int sum(int a,int b);//函数声明 int main() { cout <<&nb...
#include<iostream> using namespace std; int main() { int x=0; for(x=0;x<10;x++) { if(x==3) break;...
#include<iostream> using namespace std; struct books{ char name[10]; int num; float price; }book; int&nb...
#include<iostream> using namespace std; void addarr(int *k,int len); //文中形如sizeof(x)/sizeof(x[0]) 是用数组占用空...