I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

Similar documents
II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

10

Bar-Code_GUIDE

バーコードプリントガイド

¥ƥ­¥¹¥ȥ¨¥ǥ£¥¿¤λȤ¤˽

PPS40511.PDF

基礎情報処理 I (文字型)

PR300 電力モニタ 通信インタフェース (RS-485通信,Ethernet通信)

printf("5つの整数を入力して下さい \n"); /* データ入力 */ for( /*** 02 ***/ ){ printf("%dつ目の入力 :",i+1); scanf("%d", /*** 03 ***/ ); sum=dat[0]; /* 合計値の初期設定 */ n_max= 0

untitled

データロジックスキャニング株式会社

H02_ROM_ indd

H02_ROM_ indd

DS-3300 プログラミングマニュアル 設定項目 ページ 初期値設定マップ 1-2 ファームウェアバージョン情報 2 システム設定 3 読取機能設定 4 インターフェース設定 5 バーコード規格別読取設定 6-7 チェックデジット設定 8 読取桁数設定 9 キャラクタ付加設定 10 数字バーコード

MS240 JISⅡ半角カナ文字データを含むカード読み取り設定例

4 Mule(Emacs)

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

C言語によるアルゴリズムとデータ構造

A-GAGE High - Resolution MINI ARRAY Instruction Manual Printed in Japan J20005M

文字コードとその実装

第一章 系统讯息

Microsoft Word - 5J0080_EAN-128MenuBook_v023.doc

PowerPoint Presentation

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

型番 USB :F830-U RS232C:F830-R 組込み式 2 次元コードリーダー F830 詳細設定マニュアル Ver1.0 1

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ }

‚æ2›ñ C„¾„ê‡Ìš|

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B

データフォーマットの設定例 Ver.F

:30 12:00 I. I VI II. III. IV. a d V. VI

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf("hello World\n"); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o

:30 12:00 I. I VI II. III. IV. a d V. VI

超初心者用

データロジックスキャニング株式会社

Barcode Setup Manual

A ディジタル・マルチメータ 取扱説明書 - Sep97

‚æ4›ñ

dynabookガイド

dynabookガイド

r07.dvi

ohp07.dvi

P05.ppt

tuat1.dvi

QuickScan L Bar Code Scanner スキャナ設定ガイド

r08.dvi

ohp08.dvi

joho07-1.ppt

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç

Taro-リストⅠ(公開版).jtd

johokiso-char.pdf.pdf

kiso2-09.key

Microsoft Word - SP605取扱説明書1_0a.doc

Barcode Setup Manual

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 新装版 1 刷発行時のものです.

ITC-65 セットアップマニュアル 第 1.2 版 :

Taro-リストⅢ(公開版).jtd

main

Microsoft PowerPoint - C言語の復習(配布用).ppt [互換モード]

解きながら学ぶC言語

ex12.dvi

Z D

[1] #include<stdio.h> main() { printf("hello, world."); return 0; } (G1) int long int float ± ±

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡

Microsoft Word - CM-520BT設定マニュアル5.docx

kbd_reference.ps

A/B (2018/06/08) Ver kurino/2018/soft/soft.html A/B

橡Pro PDF

LS2200.book

char int float double の変数型はそれぞれ 文字あるいは小さな整数 整数 実数 より精度の高い ( 数値のより大きい より小さい ) 実数 を扱う時に用いる 備考 : 基本型の説明に示した 浮動小数点 とは数値を指数表現で表す方法である 例えば は指数表現で 3 書く

Welch Allyn Data Collection Inc., All rights reserved.

(2 Linux Mozilla [ ] [ ] [ ] [ ] URL 2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b

コンピュータにおける情報の表現 (2)

BW BW

Microsoft Word - ITL-3001_3001Plusマニュアル1.03版  doc

void hash1_init(int *array) int i; for (i = 0; i < HASHSIZE; i++) array[i] = EMPTY; /* i EMPTY */ void hash1_insert(int *array, int n) if (n < 0 n >=

Taro-再帰関数Ⅱ(公開版).jtd

Taro-2分探索木Ⅱ(公開版).jtd

コマンドリファレンスREV14.PDF

新・明解C言語で学ぶアルゴリズムとデータ構造

PS-800P 初期設定 最初に下記のバーコードを順番に読取ってからバーコードリーダーをお使い下さい 初期化 USB モード 日本語キーボード 以上で初期設定が完了いたしました -2 -

卒 業 研 究 報 告.PDF

P02.ppt

新・明解C言語 実践編

2 P.S.P.T. P.S.P.T. wiki 26

( )!?

プログラミング基礎

新版明解C言語 実践編

C 言語第 3 回 2 a と b? 関係演算子 a と b の関係 関係演算子 等しい a==b 等しくない a!=b より大きい a>b 以上 a>=b より小さい a<b 以下 a<=b 状態 真偽 値 条件が満たされた場合 TRUE( 真 ) 1(0 以外 ) 条件が満たされなかった場合 F

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y

専門基礎11(情報の表現)

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B

ex14.dvi

Microsoft PowerPoint - kougi9.ppt

Prog1_15th

Taro-再帰関数Ⅲ(公開版).jtd

Microsoft Word - C.....u.K...doc

Microsoft PowerPoint - 説明3_if文switch文(C_guide3)【2015新教材対応確認済み】.pptx

Microsoft Word - BW-330BTV21-設定シート_Rev3-5.docx

Transcription:

I 4 003 4 30 1 ASCII ( ) 0 17 0 NUL 16 DLE SP 0 @ P 3 48 64 80 96 11 p 1 SOH 17 DC1! 1 A Q a 33 49 65 81 97 113 q STX 18 DC " B R b 34 50 66 8 98 114 r 3 ETX 19 DC3 # 3 C S c 35 51 67 83 99 115 s 4 EOT 0 DC4 $ 4 D T d 36 5 68 84 100 116 t 5 ENQ 1 NAK % 5 E U e 37 53 69 85 101 117 u 6 ACK SYN & 6 F V f 38 54 70 86 10 118 v BEL 7 3 ETB 7 G W g 39 55 71 87 103 119 w BS 8 4 CAN ( 8 H X h 40 56 7 88 104 10 x HT EM ) 9 I Y i 9 5 41 57 73 89 105 11 y 1 ASCII LF 10 6 SUB * : J Z j 4 58 74 90 106 1 z VT 11 7 ESC + ; K [ k 43 59 75 91 107 13 { 1 13 14 15 FF CR SO SI 8 9 30 31 FS GS RS US 44 45 46 47, -. / 60 61 6 63 < = >? 76 77 78 79 L M N O 9 93 94 95 \ ] ^ _ 108 109 110 111 l m n o 14 15 16 17 } ~ DEL ( ) ASCII ( ) ASCII ASCII ASCII 0 31 17 ( ) 3 SP 1 (Space) 1 SP 33 16 ( ) ISO 646-US ISO 646-US ISO 646-JP JIS X 001 Roman 9 16 ISO 646-US (ASCII ) ISO 646-JP (JIS X 001 Roman) ISO 646-JP (JIS X 001 Roman) 9 ( ) 16 ( ) \ ( ) ~ ( ) C 1 4 1

NUL Null C 3 \0 C BEL Bell \a BS Backspace \b ( )1 HT Horizontal Tabulation \t ( ) ( 8 ) LF Line feed 4 \n C 1 VT Vertical Tabulation \v ( ) FF Form Feed 5 \f CR Carriage Return \r C.1 printf 1 byte ASCII 1 byte (= 8 bit) printf printf %c ( ) printf ascii.c 3 16 1 8 1 #include <stdio.h> 3 int main() 4 { 5 int c; 6 7 for (c = 3; c <= 16; c++) { 8 printf("%3d=%c", c, c); 9 if (c%8 == 7 c == 16) 10 printf("\n"); 11 else 1 printf(" "); 13 } 14 return 0; 15 } ascii.c 8 printf %3d %c c %3d c ( ) %c c 4 3. 3 SP ( ) 4 New Line 5 4

1 s1609h017% cc ascii.c -o ascii s1609h017%./ascii 3= 33=! 34=" 35=# 36=$ 37=% 38=& 39= 40=( 41=) 4=* 43=+ 44=, 45=- 46=. 47=/ 48=0 49=1 50= 51=3 5=4 53=5 54=6 55=7 56=8 57=9 58=: 59=; 60=< 61== 6=> 63=? 64=@ 65=A 66=B 67=C 68=D 69=E 70=F 71=G 7=H 73=I 74=J 75=K 76=L 77=M 78=N 79=O 80=P 81=Q 8=R 83=S 84=T 85=U 86=V 87=W 88=X 89=Y 90=Z 91=[ 9=\ 93=] 94=^ 95=_ 96= 97=a 98=b 99=c 100=d 101=e 10=f 103=g 104=h 105=i 106=j 107=k 108=l 109=m 110=n 111=o 11=p 113=q 114=r 115=s 116=t 117=u 118=v 119=w 10=x 11=y 1=z 13={ 14= 15=} 16=~ s1609h017% ascii.c. C ( ) (int ) C A A (ASCII 65) 4 C \n ( ) \ \ ( ) \\ ASCII ascii.c ascii.c 1 #include <stdio.h> 3 int main() 4 { 5 int c; 6 7 for (c = ; c <= ~ ; c++) 8 printf("%3d=%c%c", c, c, (c%8 == 7 c == ~ )? \n : ); 9 return 0; 10 }.3 char ASCII 0 17 C char char 1 byte (= 8 4 3

bit) 6 18 17 7 0 55 char char int.4 char char int C char char ch; 1 char 1 char ( ) int ascii.c ascii.c 5 int c; char c; c ( ) char printf char char int int printf.5 scanf 1 byte scanf 1 byte %c ( ) (scanf ) %c char (char ) chars.c 9 scanf char ( ) 5 char c; int c; 1 #include <stdio.h> 3 int main() 4 { 5 char c; 6 7 printf(" = "); 8 do { 9 scanf("%c", &c); 10 printf("%3d=%c\n", c, c); 11 } while (c!= \n ); 1 return 0; 13 } chars.c 6 C 7 C 17 17 4 4

s1609h017%./chars = This is a test. 84=T 104=h 105=i 115=s 3= 105=i 115=s 3= 97=a 3= 116=t 101=e 115=s 116=t 46=. 10= chars.c s1609h017% chars.c (Enter) chars 7 printf = (Enter) 9 scanf This is a test. (Enter) T 16 scanf T c main scanf scanf %d %f %lf () ( ) %c 1 %c " %c" scanf ( ) 3 othello09.c othello08.c (4 11 ) 1 8 a h * othello09.c 1 #include <stdio.h> 3 #define BLACK (1) /* */ 4 #define WHITE (-BLACK) /* */ 5 #define NONE (0) /* */ 4 5

6 #define OPPONENT(t) (-(t)) /* t */ 7 #define BOARD_SIZE (8) /* */ 8 9 /* */ 10 void reset(int b[][board_size]) 11 { 1 int x, y; 13 14 /* */ 15 for (x = 0; x < BOARD_SIZE; x++) 16 for (y = 0; y < BOARD_SIZE; y++) 17 b[x][y] = NONE; 18 /* 4 */ 19 b[board_size/-1][board_size/-1] = WHITE; 0 b[board_size/-1][board_size/] = BLACK; 1 b[board_size/][board_size/-1] = BLACK; b[board_size/][board_size/] = WHITE; 3 } 4 5 /* */ 6 void showboard(int b[][board_size]) 7 { 8 int x, y; 9 30 /* */ 31 for (x = 0; x < BOARD_SIZE; x++) *3 printf(" %c", x + a ); 33 printf("\n"); 34 /* */ 35 for (y = 0; y < BOARD_SIZE; y++) { *36 printf("%c", y + 1 ); 37 for (x = 0; x < BOARD_SIZE; x++) { 38 if (b[x][y] == BLACK) 39 printf(" "); 40 else if (b[x][y] == WHITE) 41 printf(" "); 4 43 else printf(" "); 44 45 } printf("\n"); 46 } 47 } 48 49 /* */ 50 void inputmove(int b[][board_size], int turn) 51 { *5 char ch; 53 int x, y; 54 55 56 while (1) { /* */ 57 *58 do { ch = ; 59 printf(" = "); *60 scanf(" %c", &ch); *61 x = ch - a ; *6 } while (x < 0 BOARD_SIZE <= x); 63 /* */ 64 *65 do { ch = ; 66 printf(" = "); *67 scanf(" %c", &ch); *68 y = ch - 1 ; 4 6

*69 } while (y < 0 BOARD_SIZE <= y); *70 if (b[x][y] == NONE) 71 break; 7 printf(" \n"); 73 74 } /* */ *75 b[x][y] = turn; 76 } 77 78 int main() 79 { 80 /* (BLACK/WHITE/NONE) */ 81 int board[board_size][board_size]; 8 /* */ 83 int turn = BLACK; 84 85 reset(board); 86 87 while (1) { showboard(board); 88 inputmove(board, turn); 89 turn = OPPONENT(turn); 90 } 91 /* */ 9 return 0; 93 } ASCII a h 1 8 s1609h017%./othello09 = c = = x = g = 4 othello09 4 7

= d = 0 = 5 = d = 7 = ^C s1609h017% 4 4.1 othello09.c 8 mprog1 othello09.c mprog1 Prog1 4. 1 othello09.c othello10.c othello10.c inputmove 1 a h 1 8 d4 ( ) char ch1 ch scanf 9 scanf(" %c %c", &ch1, &ch); scanf %c 8 othello08.c 9 scanf(" %c", &ch1); scanf(" %c", &ch); 4 8

s1609h017%./othello10 = d4 = d0 = d1 = x7 = g7 = ^C s1609h017% othello10 4.3 othello10.c othello11.c othello11.c inputmove s1609h017%./othello11 othello11 4 9

= d = g5 = 9e = 8e = ^C s1609h017% othello11.c getchar 1 q I 4 4 10

: othello08.c othello08.c 1 #include <stdio.h> 3 #define BLACK (1) /* */ 4 #define WHITE (-BLACK) /* */ 5 #define NONE (0) /* */ 6 #define OPPONENT(t) (-(t)) /* t */ 7 #define BOARD_SIZE (8) /* */ 8 9 /* */ 10 void reset(int b[][board_size]) 11 { 1 int x, y; 13 14 /* */ 15 for (x = 0; x < BOARD_SIZE; x++) 16 for (y = 0; y < BOARD_SIZE; y++) 17 b[x][y] = NONE; 18 /* 4 */ 19 b[board_size/-1][board_size/-1] = WHITE; 0 b[board_size/-1][board_size/] = BLACK; 1 b[board_size/][board_size/-1] = BLACK; b[board_size/][board_size/] = WHITE; 3 } 4 5 /* */ 6 void showboard(int b[][board_size]) 7 { 8 int x, y; 9 30 /* */ 31 for (x = 0; x < BOARD_SIZE; x++) 3 printf(" %d", x+1); 33 printf("\n"); 34 /* */ 35 for (y = 0; y < BOARD_SIZE; y++) { 36 printf("%d", y+1); 37 for (x = 0; x < BOARD_SIZE; x++) { 38 if (b[x][y] == BLACK) 39 printf(" "); 40 else if (b[x][y] == WHITE) 41 printf(" "); 4 else 43 printf(" "); 44 } 45 printf("\n"); 46 } 47 } 48 49 /* */ 50 void inputmove(int b[][board_size], int turn) 51 { 5 int x, y; 53 54 while (1) { 55 /* */ 56 do { 4 11

57 x = 0; 58 printf(" = "); 59 scanf("%d", &x); 60 } while (x <= 0 BOARD_SIZE < x); 61 /* */ 6 do { 63 y = 0; 64 printf(" = "); 65 scanf("%d", &y); 66 } while (y <= 0 BOARD_SIZE < y); 67 if (b[x-1][y-1] == NONE) 68 break; 69 printf(" \n"); 70 } 71 /* */ 7 b[x-1][y-1] = turn; 73 } 74 75 int main() 76 { 77 /* (BLACK/WHITE/NONE) */ 78 int board[board_size][board_size]; 79 /* */ 80 int turn = BLACK; 81 8 reset(board); 83 while (1) { 84 showboard(board); 85 inputmove(board, turn); 86 turn = OPPONENT(turn); 87 } 88 /* */ 89 return 0; 90 } 4 1