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;}Windows 用户 现在,请您打开之前已经安装好了的Dev C++软件,点击左上角的“文件”-“新建”-“源代码”。并在打开的编辑器里面粘贴以下代码:#include <iostream>...
什么是注释呢?这简直是废话,就像您在读书时候做的笔记,复习的时候圈的重点,简单来说,它并不是程序的一部分,但是它可以进行解释程序的行为或者任何想加在程序里面的东西。它的格式就两种,第一种/* 我是注释 我还是注释 &nb...
什么是数组呢?顾名思义,一组数,不一定是数,也可以是char类型的字符组(我自己给char类型数组起的名字)怎么创建数组呢?int 数组名[数组成员数]; int a[3];我就创建了一个叫做a的整数数组,数组中包含3个数,我应该怎么修改a数组的值呢?a[0]=1; a[1]...
/*C风格字符串的声明和使用 #include<cstdio.h> int main() { char x[]={'H','e','l','l','o','&...