CC213

Similar documents
Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

epub83-1

C/C++语言 - C/C++数据

CC213

ebook8-30

CC213

!9 第 一講 C/C++ 程式設計基礎課程簡介 講師 : 李根逸 (Ken-Yi Lee),

FY.DOC

EK-STM32F

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1.

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un

Microsoft Word _2 課本1225_OK_0222修.doc

Microsoft Word _Java_術科 .doc

Learning Java

C/C++ 语言 - 循环

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C Project 30 C Project 3 60 Project 40

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

Oracle Oracle Solaris Studio IDE makefile C C++ Fortran makefile IDE Solaris Linux C/C++/Fortran Oracle IDE "P

51 C 51 isp 10 C PCB C C C C KEIL

典型自编教材

(Microsoft Word - 11\244T\246\342\277\337\260l\302\334.doc)

投影片 1

目 录

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d

C

nooog

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9

Microsoft PowerPoint - OPVB1基本VB.ppt

1505.indd

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf("%d", &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf("%

K7VT2_QIG_v3

目 录 第 一 章 : 在 西 贡 的 童 年 和 少 年 时 代 1 第 二 章 : 真 神 大 能 分 开 红 海 11 第 三 章 : 徘 徊 旷 野 28 第 四 章 : 进 入 应 许 之 地 44 本 电 子 书 的 版 权 属 于 Sylvia Chan ( 周 慧 贤 ) 本 书 是

Microsoft PowerPoint - plan06.ppt

ebook70-19

1 CPU

untitled

2/80 2

untitled

Microsoft Word - 正文部分.doc

兒童可以節食減肥嗎?

CH01.indd

附录J:Eclipse教程

untitled

导 生 和 被 辅 导 成 员 在 辅 导 过 程 中 的 一 些 不 足 与 可 取 点, 经 过 25 分 钟 的 讨 论, 各 小 组 派 代 表 阐 述 了 各 方 观 点 和 改 进 方 法 然 后, 为 了 改 善 导 生 辅 导 方 法, 让 辅 导 变 得 更 有 效 率, 各 院

PowerPoint Presentation

Spyder Anaconda Spyder Python Spyder Python Spyder Spyder Spyder 開始 \ 所有程式 \ Anaconda3 (64-bit) \ Spyder Spyder IPython Python IPython Sp


高 职 计 算 机 类 优 秀 教 材 书 目 * 序 号 书 号 (ISBN) 书 名 作 者 定 价 出 版 / 印 刷 日 期 ** 配 套 资 源 页 码 计 算 机 基 础 课 计 算 机 应 用 基 础 刘 升 贵 年 8 月

untitled

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2

NEXT SDT2.51 C:\ARM251 SDT2.51 ARM SDT 2.51 ARM PROJECT MANAGER SDT 2

作 業 系 統 簡 介 光 有 電 腦 硬 體, 會 不 容 易 使 用 必 須 要 有 適 當 的 程 式, 才 方 便 操 作 硬 體 衍 生 作 業 系 統 需 求 : 提 供 方 便 使 用 者 執 行 程 式 平 台 有 效 使 用 各 種 電 腦 硬 體 資 源 Jingo C. Lia

Microsoft Word - 13院21号.doc

第3章.doc

untitled

AL-M200 Series

_汪_文前新ok[3.1].doc

jsj0.nps

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc

LSI U320 SCSI卡用户手册.doc

Guide to Install SATA Hard Disks

ebook

言1.PDF

Microsoft Word 軟體設計第二部份範例試題_C++_ _1_.doc

C++ 程式設計

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

大学计算机基础B.doc

, 即 使 是 在 昏 暗 的 灯 光 下, 她 仍 然 可 以 那 么 耀 眼 我 没 有 地 方 去, 你 会 带 着 我 么 杜 晗 像 是 在 嘲 笑 一 般, 嘴 角 的 一 抹 冷 笑 有 着 不 适 合 这 个 年 龄 的 冷 酷 和 无 情, 看 着 江 华 的 眼 神 毫 无 温

mvc

f2.eps

目次 

华恒家庭网关方案

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

ICD ICD ICD ICD ICD

马 克 思 主 义 学 院 经 济 与 工 商 管 理 学 院 公 共 管 理 学 院 法 学 院 社 会 学 院 外 国 语 学 院 中 国 现 当 代 史 世 界 中 古 史 世 界 近 现 代 史 文 化 遗 产 马 克 思 主 义 哲 学 国 际 政 治 科 学 社 会 主 义 马 克 思

廳, 一 道 道 經 過 營 養 師 建 議 的 菜 餚, 被 美 美 地 擺 放 在 雅 緻 的 白 色 康 寧 餐 具 上, 而 且 餐 廳 設 有 水 果 部 門, 不 但 提 供 新 鮮 果 汁, 一 盤 盤 特 別 挑 選 過, 又 大 又 美 的 各 色 水 果, 如 蓮 霧 梨 子 芭

摘 要 在 這 忙 碌 的 社 會 中, 普 遍 人 們 運 動 時 間 其 實 並 不 充 裕, 體 力 越 來 越 差 的 情 況 下 還 隨 意 飲 食 導 致 身 體 健 康 越 來 越 差, 因 此 本 專 題 打 算 利 用 健 康 飲 食 的 方 式 改 善 這 些 人 的 體 質,

1 C++ 2 Bjarne Stroustrup C++ (system programming) 6 (infrastructure) C++ 7 Herb Sutter 8 C++ (efficiency) (flexibility) 9 (abstraction) (productivity

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

Microsoft Word - 全華Ch4Ans.doc

2.1 n ~á CPU q ˆ ~ µƒã î ˆ C++ à nù eô 1. (edit) 2. Í (preprocess) 3. (compile) 4. (link) 5. (load) 6. ˆ (execute) µl ô Ãs nù (editor) Í (preprocessor

Measurement Studio Expands Your Test and Measurement Programming Power

( )

國人之健康行為初探

内 容 培 训 目 标 基 础 知 识 常 用 监 控 命 令 在 实 战 中 综 合 运 用 2

Abstract arm linux tool-chain root NET-Start! 2

闖 關 組 4. 任 一 隊 員 曾 獲 得 第 一 屆 第 2 次 全 國 大 專 ITSA 盃 程 式 設 計 桂 冠 挑 戰 大 賽 菁 英 組 前 三 名 或 歷 屆 全 國 大 專 ITSA 盃 程 式 設 計 桂 冠 挑 戰 大 賽 挑 戰 組 前 三 名 應 報 此 組 5. 任 一

D C 93 2

GoFlex Home UG Book.book

untitled

一个开放源码的嵌入式仿真环境 ― SkyEye

我的生命哲學 五觀三一 陳學霖

A Preliminary Implementation of Linux Kernel Virus and Process Hiding

Microsoft Word - 選擇_無解答2_.doc

VB程序设计教程

天津商学院(二).DOC

C 1

Transcription:

: (Ken-Yi Lee), E-mail: feis.tw@gmail.com 9

[P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10

C / C++ C C++ C C++ C++ C ( ) C++ C (C 2.0?) 11

C/C++ : (Compiler): Microsoft Visual C++ (MSVC++) The GNU Compiler Collection (GCC) (IDE: ): Microsoft Visual Studio 2010 (MSVC++) Dev C++ (GCC) : Code blocks, Qt Creator,. Microsoft Visual Studio Dev C++ Dev C++ 12

(http://c.feis.tw) 13

( ) : 14

C : How To Program C The C Programming Language The C++ Programming Language C C/C++ 15

(60%) (40%) 70 19:00 20:00 20:10 21:00 1 Q&A 21:30 2-8, 10-12 19:00 19:20 19:30 Q&A 19:40 20:40 20:40 21:30 9 19:00 20:50 21:00 Q & A 21:30 16

( 100 ) ( ) 17

18

(Programming Language) : A programming language is an artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine, to express algorithms precisely, or as a mode of human communication. - Wikipedia (control) (machine) 19

什麼是電腦 from Wikipedia 20

電腦的組成 抽象來說 電腦內包含了 輸入單元 (Input): 例如鍵盤和滑鼠 (感官) 輸出單元 (Output): 例如螢幕和印表機 (嘴巴 肢體) 輔助儲存單元 (Storage) : 例如硬碟和光碟 記憶單元 (Memory): 例如記憶體 程式設計核心 (記憶與計算) 中央處理單元 (CPU) 21

: : +1300042774 (01001101011111010001010000010110) +1400593419 (01010011011110110101110000001011) +1200274027 (01000111100010101011101001101011) : LOAD A ADD B STORE SUM : SUM = A + B : (x86, ARM,...) C, C++, Java, Pascal, Python,... 22

C / C++ C 1972 Dennis Ritchie 1978 The C Programming Language C 1989 (ANSI) ANSI C ( C89) 1999 (ISO) ISO/IEC 9899:1999 ( C99) [ ] C++ C C (OOP) 23

24

Dev C++ > > Bloodshed Dev C++ > Dev C++ (IDE) (*.cpp) (*.exe) 25

Dev C++ Dev C++ Microsoft Visual Studio (IDE) Tab Dev C++ : Tools ( ) > Editor Options ( ) > General ( )

: File ( ) > New ( ) > Source file ( ) : File ( ) > Save [As] ( ) ( ) cpp : File ( ) > Open Project or File ( / ) 27

(.c,.cpp) (Compile) (.exe) (Run) : Execute ( ) > Compile ( ) Ctrl + F9 Done F9 Execute ( ) > Run ( ) Ctrl + F10 Execute ( ) > Compile&Run( ) F9 28

Hello world (1) (helloworld_1.cpp) /* My first program */ #include <stdio.h> int main() { printf( Hello world!\n ); return 0; } printf( ) 29

Hello world (2) (helloworld_2.cpp) /* My first program */ #include <stdio.h> #include <stdlib.h> int main() { printf( Hello world!\n ); system( pause ); return 0; } system( ) pause MS-DOS 30

Hello world (3) (helloworld_3.cpp) /* My first program */ #include <stdio.h> #include <stdlib.h> int main() { printf( Hello ); printf( world!\n ); system( pause );; return 0; } 31

(print.cpp) H H A H H A A HHHHHH A A H H AAAAAAA H H A A print(...) 32

printf \n Newline ( ) \t Tab ( ) \\ \ 33

(add.cpp) /* Addition program */ #include <stdio.h> #include <stdlib.h> int main(){ int integer1; int integer2; int sum; printf("please enter the first integer: "); scanf("%d", &integer1); printf("please enter the second integer: "); scanf("%d", &integer2); sum = integer1 + integer2; printf("sum is %d\n", sum); system("pause"); return 0; } 34

/* Addition program */ #include <stdio.h> #include <stdlib.h> int main() { int integer1; int integer2; int sum; int printf("please enter the first integer: "); scanf("%d", &integer1); scanf (%d ) 2293620 integer1 (int)? integer2 (int)? } printf("please enter the second integer: "); scanf("%d", &integer2); sum = integer1 + integer2; printf("sum is %d\n", sum); system("pause"); return 0; printf 内 %d printf( Sum is sum );? 2293616 2293612 sum (int)? 35

C / C++ 3 + 4 * 5! ( ) (=) + - * / % = 36

(multi2.cpp) : add.cpp Please enter the first integer: 3 Please enter the second integer: 4 Product is 12 (multi3.cpp) : multi2.cpp Please enter the first integer: 3 Please enter the second integer: 4 Please enter the third integer: 5 Product is 60 37

(calc.cpp) Please enter the first integer: 3 Please enter the second integer: 4 Please enter the third integer: 5 Sum is 12 Average is 4 Product is 60 (squared.cpp) N = 3 N^2 = 9 38

printf scanf printf : printf( Sum is %d\n, sum); printf( Average is %d\n, average); printf( Product is %d\n, product); : printf( Sum is %d\naverage is %d\nproduct is %d\n, sum, average, product); scanf : scanf( %d%d%d, &integer1, &integer2, &integer3); printf % printf( Sum is %5d\n, sum); printf( Sum is %05d\n, sum); 39

(digit1.cpp) % : 12345 : 5 : 54321 : 1 (digit3.cpp) : 12345 : 3 : 54321 : 3 40

(1) [E0101] : Alice: How are you? Bob: Fine. Thank you. [E0102] Welcome to C world! Hope you have a nice day! : \ [E0103] 7 [E0104] 129263 + 54628 41

(2) [E0105] [E0106] x 3x 2 +4x-1 [E0107] helloworld_2.cpp [E0108] = - 1911 42

(3) [E0109] = 5 ( -32)/9 [E0110] (BMI) BMI = (kg) / (m 2 ) [E0111]* 129263 * 54628 [E0112] 43

44

45

46

47

48