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;}#include <iostream> using namespace std; int addnum(int a,int b) { return a+b; } int ...
讲到函数就可以讲讲局部变量和全局变量了,什么是局部变量呢?什么又是全局变量? #include <iostream> using namespace std; int x,y,z;//x,y,z是全局变量 i...
C++中的运算符,直接看例子:int a=7,b=2,c=0; c=a+b; c=a-b; c=a*b; c=a/b; c=a%b;请大家猜猜其中c的值分别是什么?int a=7,b=2,c=0; c=a+b;//9 c=a-b;//5 c=a*b;//15 c...
#include <iostream> using namespace std; class fenshu { public: int xuehao; int yuwen; }; ...
#include<iostream> void print(); int main() { char a=0; for(a=0;a<20;a++) print(); return 0; } v...
/*C风格字符串的声明和使用 #include<cstdio.h> int main() { char x[]={'H','e','l','l','o','&...