CC213

Similar documents
新・明解C言語入門編『索引』

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

C C

新版 明解C++入門編

C/C++程序设计 - 字符串与格式化输入/输出

FY.DOC

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

untitled

nooog

untitled

CC213

C/C++ - 文件IO

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit

C 1

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

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha

Ps22Pdf

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

untitled

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

C/C++语言 - 分支结构

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;

Microsoft Word - 01.DOC

c_cpp

3.1 num = 3 ch = 'C' 2

Microsoft Word - CPE考生使用手冊 docx

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++ 语言 - 循环

untitled

,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : : : /16 : : 96 : : : ISBN 7

untitled

C语言的应用.PDF

(Microsoft Word - Motion Program \270\305\264\272\276\363 \307\245\301\366 \271\327 \270\361\302\367.doc)

untitled

华恒家庭网关方案

!"# $%& %!"# $%& %!"#$%& %! ( )***%% ) $)! +**+),,* -)+.* )( ) +, +*.*)+..**! )$,*)+$))$!"!#

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

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

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>

untitled

untitled

C/C++ - 数组与指针

(京)新登字063号

CC213

FZUBRIDGE

untitled

《C语言程序设计》教材习题参考答案

Microsoft PowerPoint - ds-1.ppt [兼容模式]

2015年计算机二级(C语言)模拟试题及答案(四)

untitled

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

C

科学计算的语言-FORTRAN95

untitled

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

保母人員丙級應檢資料第二部份 doc

学习MSP430单片机推荐参考书

四川省普通高等学校

bingdian001.com


<453A5C C435CB3F6B0E65C43D3EFD1D4C9EEB6C8BDE2C6CA5C43D3EFD1D4C9EEB6C8BDE2C6CA5FB1EAD7BC5C43D3EFD1D4C9EEB6C8BDE2C6CA5FB1EAD7BC5C43D3EFD1D4C9EEB6C8BDE2C6CA5FB1EAD7BC312E646F63>

《米开朗琪罗传》

ebook14-4

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

国信证券股份有限公司

第一章

C++ 程式設計

Microsoft PowerPoint - OPVB1基本VB.ppt

uc/os 1

untitled

Java

untitled

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("%

OOP with Java 通知 Project 2 提交时间 : 3 月 14 日晚 9 点 另一名助教 : 王桢 学习使用文本编辑器 学习使用 cmd: Power shell 阅读参考资料

5-1淡江大學學則950602

Microsoft Word - 095_ 什麼最快樂 (白話與經文加註)-ok .doc

概述


C

团 学 要 闻 我 校 召 开 共 青 团 五 届 九 次 全 委 ( 扩 大 ) 会 议 3 月 17 日, 我 校 共 青 团 五 届 九 次 全 委 ( 扩 大 ) 会 议 在 行 政 办 公 楼 五 楼 会 议 室 举 行, 校 团 委 委 员 各 院 ( 系 ) 团 委 书 记 校 学 生

Microsoft Word - 实用案例.doc

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

全国计算机技术与软件专业技术资格(水平)考试

untitled

e 2 3 2

epub 33-8

Microsoft PowerPoint - course2.ppt

download.kaoyan.com_2006ÄêÌì½ò¹¤Òµ´óѧ¸ß¼¶ÓïÑÔ³ÌÐòÉè¼Æ£¨409£©¿¼ÑÐÊÔÌâ

2012年全国计算机等级考试二级C语言考试大纲

Microsoft Word - CIN-DLL.doc

chap07.key

元 [ 所 ] IA27 ( D ) 下 列 何 項 情 況, 其 夫 妻 所 得 可 免 合 併 申 報? (A) 當 年 度 結 婚 (B) 當 年 度 離 婚 (C) 妻 58 歲, 夫 62 歲 無 所 得 受 其 子 扶 養 (D) 以 上 皆 是 [ 所 ]

胃癌早诊早治技术方案.doc

z x / +/- < >< >< >< >< > 3 b10x b10x 0~9,a~f,A~F, 0~9,a~f,A~F, x,x,z,z,?,_ x,x,z,z,?,_ h H 0~9,_ 0~9,_ d D 0~7,x,X,z,Z

Microsoft Word 養生與保健_中山大學_講義


萬里社區老人健康照護手冊

Microsoft Word - 強制汽車責任保險承保及理賠作業處理辦法 doc

Microsoft Word - 06.Understanding of Pregnancy and Birth.doc

Transcription:

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

[P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : <, >, <=, >=, ==,!= [P.69] [P.70] [P.71] 50

(Data type) ( ) :,... (Bit) ( ) ( ) 0 1 51

C (bytes) (Integer) int 4* 32 (Long Integer) long 4* 32 (Long Long Integer) long long 8 32 (Character) char 1 ʻaʼ (Single Precision Floating Point) (Double Precision Floating Point) float 4 4.39 double 8 4.39 void?? sizeof() 52

; int num; = ; int num = 0; (keywords) num (int) 0 2293620 ( ) C ( ) auto, break, case, char, const, continue, default, do, double, else, enum, extern, float, for, goto, if, int, long, register, return, short, signed, sizeof, static, struct, switch, typedef, union, unsigned, void, volatile, while 53

sizeof sizeof() (Bytes) [1 Byte = 8 Bits] sizeof.cpp 32-bit long 4 bytes 64-bit long 8 bytes 54

(int) (char) (int) (float) (int) (long long) (float) (double) ( ) (int) (unsigned int) 55

Bit (0 1) Byte 8 Bit Byte 2 8 = 256 ( [signed]) -128 127 ( 256 ) [unsigned] 0 255 4 Byte : 2 8x4 = 2 32 = 4,294,967,296 4 Byte int 2,147,483,648 2,147,483,647 ( ) 4 Byte unsigned int 0 4,294,967,295 ( ) 56

(int) 32 bit (4 bytes) 2 : 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2147483647 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1-2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0-255 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1-2147483648 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 57

(floating point) IEEE (1 Bit),, 7707 0 0 0 1 1 1 1 0 0 0 0 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 0 1 1 ) ) ) [ ] + 3 1563 + 0.1563 10 3 float 7 double 15 ( http://goo.gl/imxgf 58

printf scanf (Integer) int %d (Long Integer) long %ld (Long Long Integer) long long %lld %I64d (Character) char %c (Single Precision Floating Point) (Double Precision Floating Point) float %f double %f, %lf printf scanf 59

(calc.cpp) (calc_1.cpp) ( ) : : float scanf %f float printf %f float printf %.3f 60

3 (Integer) int 3. (Double Precision Floating Point) 3.f (Single Precision Floating Point) double float 3 (Character) char constant.cpp 61

( ) ( ) : 4 / 3 4 / 3. 4 / 3 int 4 / 3. 4 int 3. double 4 double 3. double ( ) (double) 4 / 3 4 double ( 4. ) 3 3 double ( 3.) double 62

casting.cpp casting.cpp A = B B A B A B A printf scanf : printf( %d, 3.); 3. double int printf scanf 63

(bignum) int log(2 31 ) ~ 9.3 long long log(2 63 ) ~ 19.0 Dev C++ %I64d long long 64

char (ASCII ) ( ) ASCII A +1? (char) (int)(???) A -1? (char) (int)(???) A + 1? (char)(char)(???) [ ] char int char.cpp 65

(tolower) char input =?; char output = input - A + a ; : A : a : B : b : Z : z 66

: +-*/% (*/% +- ) A = 3 * ( 2 + 1 ) + 7 / 2 + 9 * 3.; A = 3 * 3 + 7 / 2 + 9 * 3.; A = 9 + 7 / 2 + 9 * 3.; A = 9 + 3 + 9 * 3.; A = 9 + 3 + 27. ; A = 12 + 27. ; A = 39. ; 67

: = = (=) ( ) int A,B; double C, D; A = 3; 3 = A; A = B = 3; A = C = B = D = 3 + 7 / 2. ; assign.cpp 68

0 0 0 1 2-1 69

0 0 0 ( ) 0 ( ) > < ( ) >= ( ) <= == 4 > 3 4 < 3 4 == 3 4!= 3 4 > 3 > 2!= 70

0 0 0 ( ) 0 ( ) C and or (and) && (or) (not)! 1 && 1 1 && 0 1 1 1 0 4 > 3 && 3 > 2 4 > 3 && 4 < 3 4 > 3 4 < 3!1 71

( )! * / % + - < > <= >= ==!= = && 72

if... if ( ) {... }... if (80 >= 60) { printf( PASSED!\n ); } if (80 < 60) { printf( FAILED!\n ); } int grade = 80; if (grade >= 60) { printf( PASSED!\n ); } if (grade < 60) { printf( FAILED!\n ); } 73

(cmp) : : 3 : 4 : 4 : ( ) int max; if (num1 >= num2) { max = num1; } if (num1 < num2) { max = num2; } printf( %d\n, max); 74

(guess) : 3 : 5 : 4 75

Bitwise AND & Bitwise OR Bitwise XOR ^ Bitwise NOT ~ Bitwise Left Shift << Bitwise Right Shift >> 76

(1) [E0201] double x = 3000000000000000.5; [E0202]* 3000000000000000.5+0.05 [E0203] ( ) [ = * 1.6] [E0204] 129263*54628 [E0110] [E0205]* 1292635428 (2159872744519190546127922752) 77

(2) [E0206] (>=0) (< 0) [E0207] (0-9) (a-za-z) (char) scanf %c printf %c [E0208] [E0209] ( ) 78

(3) [E0210] : 3 6 : 3 6 : 6 3 : 3 6 [E0211] : 38603456 3 8 6 0 3 4 5 6 79

(4) [E0213] ( ) : (A: 10, B:11, C:12,..., Z:36) %c%d A 1 2 3 4 5 6 7 8 1 0 1 2 3 4 5 6 7 8 x1 x9 x8 x7 x6 x5 x4 x3 x2 x1 = 1x1 + 0x9 + 1x8 + 2x7 + 3x6 + 4x5 + 5x4 + 6x3 + 7x2 + 8x1 = 121 121%10 = 1, (10-1)%10 = 9 80