# 程序結構
在介紹C++語言程序的結構之前,我們先來看一個簡單的例子:
例:在屏幕上輸出“Hello World!”。
```
#include<iostream> //使用cin,cout,須調用iostream 庫,否則編譯出錯
#include<cstdlib> // 使用system( )調用cstdlib庫
using namespace std; //在C語言中要省略,例如在VC++和TC++中
int main() { //有的C語言可用void main(),例如TC++和VC++
cout<<"Hello World!"<<endl; //輸出"Hello World!"
system("pause"); //暫停作用,使用system("pause")調用cstdlib庫
return 0; //結束整個程序
}
```
運行結果:
```
Hello World!
```
```[youku]
XNDM3NTkyNTIyNA
```
*****
## 優酷視頻獲取API
~~~[api]
get:https://api.youku.com/videos/by_me.json
*string:
client_id=0bef1233a4ad826b#優酷賬號ID
access_token=1b00c140ba89f6b49d0c4c64074cf679#token值/每月更新一次
<<<
success
<<<
error
~~~
```[sql]
~~~
CREATE TABLE `plugin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`title` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`version` varchar(255) NOT NULL,
`readme` text,
`config` text,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
~~~
```
# 數學公式的使用
`$ c = \pm\sqrt{a^2 + b^2} $`
# 流程圖
```[flow]
st=>start: Start
e=>end
op1=>operation: My Operation
sub1=>subroutine: My Subroutine
cond=>condition: Yes
or No?:>http://www.google.com
io=>inputoutput: catch something...
st->op1->cond
cond(yes)->io->e
cond(no)->sub1(right)->op1
```