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

Size: px
Start display at page:

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

Transcription

1 A/B (2018/06/08) Ver kurino/2018/soft/soft.html A/B OHP Download : kurino/2018/soft/soft.html 2 kurino/2018/soft/ / html 1

2 1 1.1 OHP OHP (HTML) 3 (PDF) Download update.zip 5 hanoi.zip 6 miku.zip 7 sample c c 9 ( c (SJIS) 10 ) 1: c QQQQ.c #include <strings.h> double_print (message) [ : ] double_print ( "" ); "" ( ) double_print ( "abc" ); aabbcc double_print ( "abcdef" ); ^^^ aabbccddeeff 3 ohp/html/index.html 4 ohp/ohp.pdf 5 files/ update.zip 6 files/hanoi.zip 7 files/miku.zip 8 files/sample c 9 p/ c 10 p/sjis/ c 1

3 ^^^^^^====== duble_print ( "abcdef" ) duble_print ( "abc" ) aabbcc duble_print ( "def" ) ddeeff duble_print ( "abcdef" ) a double_print ( "bcdef" ) duble_print ( message ) message message putchar double_print ( message + 1 ) void double_print ( char message ) { if (!strcmp ( message, "" ) ) { putchar ( message ); double_print ( message + 1 ); main int main ( void ) { double_print ( "abc" ); printf ( "\n" ); double_print ( " " ); printf ( "\n" ); c 11 ( c (SJIS) 12 ) 11 p/ c 12 p/sjis/ c 2

4 2: c QQQQ.c #include <strings.h> reverse_print (message) void reverse_print ( char message ) { if (!strcmp ( message, "" ) ) {... main int main ( void ) { putchar ( message ); reverse_print ( message + 1 ); : ; reverse_print ( "abc" ); printf ( "\n" ); reverse_print ( " " ); printf ( "\n" ); 3

5 hanoi3.c 13 (hanoi3.c (SJIS) 14 ) 3: hanoi3.c 2018/06/08 hanoi3.c 3 s_hanoi.h #include "s_hanoi.h" int main ( void ) { "1" s_hanoi_init() : : s_hanoi_size ( char discs ) : s_hanoi_move ( char from, char to ) : from to s_hanoi_clear () : s_hanoi_stop() : : return 0 s_hanoi_init(); s_hanoi_size ( "" ); // 3 putchar ( > ); putchar ( getchar() ); s_hanoi_move ( "1", "3" ); [1] 1 3 putchar ( > ); putchar ( getchar() ); s_hanoi_move ( "1", "2" ); [2] 1 2 putchar ( > ); putchar ( getchar() ); s_hanoi_stop(); 13 p/hanoi3.c 14 p/sjis/hanoi3.c 4

6 p-001.c 15 (p-001.c (SJIS) 16 ) 4: p-001.c n (nprint) void nprint(char ntimes) { if (!strcmp ( ntimes, "" ) ) { ntimes do nothing printf ( "Hello, World\n" ); nprint ( ntimes + 1 ); nprint ( "" ); nprint ( "12345" ); p-002.c 17 (p-002.c (SJIS) 18 ) 5: p-002.c n (nprint) void nprint(char ntimes, char message) { 15 p/p-001.c 16 p/sjis/p-001.c 17 p/p-002.c 18 p/sjis/p-002.c if (!strcmp ( ntimes, "" ) ) { do nothing 5

7 printf ( message ); nprint ( ntimes + 1, message ); nprint ( "", "Hello, World\n" ); nprint ( "12345", " \n" ); p-003.c 19 (p-003.c (SJIS) 20 ) 6: p-003.c n (nprint) void nprint(char ntimes, char message) { if (!strcmp ( ntimes, "" ) ) { do nothing printf ( message ); nprint ( ntimes + 1, message + 1); nprint ( "", "Hello, World\n" ); nprint ( "12345", " \n" ); 19 p/p-003.c 20 p/sjis/p-003.c 6

8 p-004.c 21 (p-004.c (SJIS) 22 ) 7: p-004.c printf ( " \"abc\" " ); putchar ( "abc" ); "abc" a printf ( " \n" ); p-005.c 23 (p-005.c (SJIS) 24 ) 8: p-005.c printf ( " \"abc\" + 1 " ); putchar ( ("abc"+1) ); "abc" b printf ( " \n" ); p-006.c 25 (p-006.c (SJIS) 26 ) 9: p-006.c printf ( " \"abc\" + 1 " ); putchar ( "abc"[1] ); "abc" b "abc"[1] => ("abc"+1) 21 p/p-004.c 22 p/sjis/p-004.c 23 p/p-005.c 24 p/sjis/p-005.c 25 p/p-006.c 26 p/sjis/p-006.c 7

9 printf ( " \n" ); p-007.c 27 (p-007.c (SJIS) 28 ) 10: p-007.c n (nprint) void nprint(char ntimes) { "" if ( ntimes == \0 ) { ntimes \0 (EOS) do nothing printf ( "Hello, World\n" ); nprint ( ntimes + 1 ); ntimes "" nul nprint ( "" ); nprint ( "12345" ); p-008.c 29 (p-008.c (SJIS) 30 ) 11: p-008.c myprintf 27 p/p-007.c 28 p/sjis/p-007.c 29 p/p-008.c 30 p/sjis/p-008.c 8

10 myprintf ( "abc" ); => abc Version 1 : printf void myprintf (char string) { printf ( string ); printf myprintf ( "Hello, World\n" ); myprintf ( " \n" ); p-009.c 31 (p-009.c (SJIS) 32 ) 12: p-009.c myprintf myprintf ( "abc" ); => abc Version 2 : printf putchar myprintf ( "abc" ); => abc => a bc => putchar ( a ); myprinf ( "bc" ); => putchar ( "abc" ); myprinf ( "abc" + 1 ); myprintf ( string ); => putchar ( string ) ; myprintf ( string + 1 ); string "" void myprintf (char string) { if ( string == \0 ) { putchar ( string ); myprintf ( string + 1 ); 31 p/p-009.c 32 p/sjis/p-009.c myprintf ( "Hello, World\n" ); myprintf ( " \n" ); 9

11 p-010.c 33 (p-010.c (SJIS) 34 ) 13: p-010.c myprintf version 3 (^o^) void myprintf (char string) { if ( string == \0 ) { if ( string == ) { printf ( "(^o^)" ); putchar ( string ); myprintf ( string + 1 ); printf ( "Hello, World\n" ); myprintf ( "Hello, World\n" ); printf ( "Hello, World \n" ); myprintf ( "Hello, World \n" ); p-011.c 35 (p-011.c (SJIS) 36 ) 14: p-011.c 33 p/p-010.c 34 p/sjis/p-010.c 35 p/p-011.c 36 p/sjis/p-011.c 10

12 myprintf version 3 (^o^) #define EOS \0 \0 EOS EOS \0 EOS = End Of String EOS \0 #define SMAILE void myprintf (char string) { if ( string == EOS ) { if ( string == SMAILE ) { printf ( "(^o^)" ); putchar ( string ); myprintf ( string + 1 ); printf ( "Hello, World\n" ); myprintf ( "Hello, World\n" ); printf ( "Hello, World \n" ); myprintf ( "Hello, World \n" ); p-012.c 37 (p-012.c (SJIS) 38 ) 15: p-012.c n (nprint) nprint ( "abc" ); => Hello, World Hello, World 37 p/p-012.c 38 p/sjis/p-012.c 11

13 Hello, World => Hello, World Hello, World Hello, World => printf ( "Hello, World\n" ): nprint ( "bc" ); nprint ( "abc" ); => Hello, World Hello, World Hello, World => Hello, World Hello, World Hello, World => nprint ( "bc" ); printf ( "Hello, World\n" ): void nprint(char ntimes) { if (!strcmp ( ntimes, "" ) ) { ntimes do nothing nprint ( ntimes + 1 ); printf ( "Hello, World\n" ); nprint ( "" ); nprint ( "12345" ); p-013.c 39 (p-013.c (SJIS) 40 ) 16: p-013.c 39 p/p-013.c 40 p/sjis/p-013.c 12

14 n (nprint) nprint ( "" ) => => => printf ( "" ); printf ( "\n" ); nprint ( "" ); [ ] nprint ( message ) => printf ( message ); printf ( "\n" ); nprint ( message + 1 ); #define EOS \0 void nprint(char ntimes) { if ( ntimes == EOS ) { ntimes do nothing printf ( ntimes ); printf ( "\n" ); putchar ( \n ) nprint ( ntimes + 1 ); nprint ( "" ); nprint ( "12345" ); p-014.c 41 (p-014.c (SJIS) 42 ) 17: p-014.c 41 p/p-014.c 42 p/sjis/p-014.c 13

15 n (nprint) nprint ( "" ) => nprint ( "" + 1 ); printf ( "" ); printf ( "\n" ); => nprint ( "" ); printf ( "" ); printf ( "\n" ); => nprint ( "" + 1 ); printf ( "" ); printf ( "\n\" ); printf ( "" ); printf ( "\n" ); =>.. => #define EOS \0 void nprint(char ntimes) { if ( ntimes == EOS ) { ntimes do nothing nprint ( ntimes + 1 ); printf ( ntimes ); printf ( "\n" ); putchar ( \n ) nprint ( "" ); nprint ( "12345" ); 14

16 memo.txt 43 (memo.txt (SJIS) 44 ) 18: memo.txt [ ] => n : [ ] "ABC" : 3 A, B, C [C?] : "abc" <=> a "abc" + 1 => "bc" ("abc"+1) => ("bc") => b "abc" => "abc" 0 ( ) "abc" => ("abc"+0) ("abc"+1) => "abc" 1 ( ) ("abc"+n) => "abc" n "abc"[n] "abc"[n] => ("abc"+n) "abc" 0, "abc"[0] "" ( 0 ) "" => \0 ( : ) "abc" = { a, b, c, \0 "" = { \0 # \0 nul End of String (EOS) str str == \0!strcmp ( str, "" )!strcmp ==!! = == == 43 p/memo.txt 44 p/sjis/memo.txt 15

17 #define #define double_print ( "abc" ); => aabbcc reverse_print ( "abc" ); => cba => cb a => reverse_print ( "bc" ); putchar ( a ) => reverse_print ( "abc" + 1 ); putchar ( "abc" ) [ ] reverse_print ( message ); => reverse_print ( message + 1 ); putchar ( message ); : 3 Download : c 45 19: c QQQQ.c 3 s_hanoi.h #include "s_hanoi.h" int main ( void ) { 45 ex/01/q/01.c 16

18 "1" "2" s_hanoi_init() : : s_hanoi_size ( char discs ) : s_hanoi_move ( char from, char to ) : from to s_hanoi_clear () : s_hanoi_stop() : : return 0 s_hanoi_init(); s_hanoi_set ( char discs ) 3 printf ( " [Enter] \n" ); putchar ( > ); putchar ( getchar() ); (3) s_hanoi_move ( "1", "2" ); 1 2 ( 1 ) s_hanoi_move ( "1", "3" ); 1 3 ( 2 ) s_hanoi_move ( "1", "2" ); 1 2 ( 3 ) s_hanoi_move ( "3", "1" ); 3 1 ( 1 ) s_hanoi_move ( "1", "2" ); 1 2 ( 1 ) printf ( " [Enter] \n" ); putchar ( > ); putchar ( getchar() ); s_hanoi_stop(); 17

19 $./ QQQQ.exe $ 1: c 18

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

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B A/B (2018/10/19) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2018/soft/soft.html 2018 10 19 A/B 1 2018 10 19 2 1 1 1.1 OHP.................................... 1

More information

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

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B A/B (2010/10/08) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2010/soft/soft.html 2010 10 8 A/B 1 2010 10 8 2 1 1 1.1 OHP.................................... 1 1.2.......................................

More information

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) * *

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) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 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) +

More information

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 : 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)* ( 2016 2016 07 28 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF : 11011 N N 0 N N 11 1001 N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) 1100100 (2) 1111011 (3) 1110010 (4) 1001011

More information

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

:30 12:00 I. I VI II. III. IV. a d V. VI 2017 2017 08 03 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF X [ S ] a S S ; X X X, S [, a, ], ; BNF X (parse tree) (1) [a;a] (2) [[a]] (3) [a;[a]] (4) [[a];a] : [a] X 2 222222

More information

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information

81 34 6 5 6 6 5 5 6 1 5 2 6 176 414

81 34 6 5 6 6 5 5 6 1 5 2 6 176 414 5 6 5 6 5 6 5 4 4 6 5 5 5 413 175 81 34 6 5 6 6 5 5 6 1 5 2 6 176 414 1 5 5 12 3 4 5 1 1 2 3 2 1 415 177 81 34 2 3 4 5 3 1 2 4 5 1 1 1 4 178 416 65,000 35,000 6,000 2 4 417 179 81 34 4 10,000 5,000 750

More information

1-4 int a; std::cin >> a; std::cout << "a = " << a << std::endl; C++( 1-4 ) stdio.h iostream iostream.h C++ include.h 1-4 scanf() std::cin >>

1-4 int a; std::cin >> a; std::cout << a =  << a << std::endl; C++( 1-4 ) stdio.h iostream iostream.h C++ include.h 1-4 scanf() std::cin >> 1 C++ 1.1 C C++ C++ C C C++ 1.1.1 C printf() scanf() C++ C hello world printf() 1-1 #include printf( "hello world\n" ); C++ 1-2 std::cout

More information

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

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

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

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information

140 120 100 80 60 40 20 0 115 107 102 99 95 97 95 97 98 100 64 72 37 60 50 53 50 36 32 18 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 1 100 () 80 60 40 20 0 1 19 16 10 11 6 8 9 5 10 35 76 83 73 68 46 44 H11

More information

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

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 18 C ( ) 1 1 1.1 hello world.c 5 printf("hello World\n"); 6 } [ ] [ ] #include % cc hello_world.c %./a.out Hello World [a.out ] % cc hello_world.c -o hello_world [ ( ) ] (K&R 4.1.1) #include

More information

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

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 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

More information

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

‚æ2›ñ C„¾„ê‡Ìš| I 8 10 10 I ( 6 ) 10 10 1 / 23 1 C ( ) getchar(), gets(), scanf() ( ) putchar(), puts(), printf() 1 getchar(), putchar() 1 I ( 6 ) 10 10 2 / 23 1 (getchar 1 1) 1 #include 2 void main(void){ 3 int

More information

10

10 2: http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html kota@fbs.osaka-u.ac.jp 10 : 0 1 2 n 2 n 0 1 1 0 1 0 0 1 (2) = 105 1 = 8 1 2 8 = 256 0 9 105 i 106 j 256 2 1 #include int main(void)

More information

福岡大学人文論叢47-3

福岡大学人文論叢47-3 679 pp. 1 680 2 681 pp. 3 682 4 683 5 684 pp. 6 685 7 686 8 687 9 688 pp. b 10 689 11 690 12 691 13 692 pp. 14 693 15 694 a b 16 695 a b 17 696 a 18 697 B 19 698 A B B B A B B A A 20 699 pp. 21 700 pp.

More information

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

54 144 144 144 144 144 80 152 84 122 HTML

54 144 144 144 144 144 80 152 84 122 HTML 54 144 144 144 144 144 80 152 84 122 HTML P20 P24 P28 P40 P54 P84 P122 P138 P144 P152 P220 P234 P240 P242 1 1-1 1-2 1-3 1-4 1-5 1 1-6 1 2 2-1 2-2 A C D E F 2 G H I 2-3 2-4 C D E E A 2

More information

/* 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

/* 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 1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html kota@fbs.osaka-u.ac.jp /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );

More information

joho07-1.ppt

joho07-1.ppt 0xbffffc5c 0xbffffc60 xxxxxxxx xxxxxxxx 00001010 00000000 00000000 00000000 01100011 00000000 00000000 00000000 xxxxxxxx x y 2 func1 func2 double func1(double y) { y = y + 5.0; return y; } double func2(double*

More information

8 / 0 1 i++ i 1 i-- i C !!! C 2

8 / 0 1 i++ i 1 i-- i C !!! C 2 C 2006 5 2 printf() 1 [1] 5 8 C 5 ( ) 6 (auto) (static) 7 (=) 1 8 / 0 1 i++ i 1 i-- i 1 2 2.1 C 4 5 3 13!!! C 2 2.2 C ( ) 4 1 HTML はじめ mkdir work 作業用ディレクトリーの作成 emacs hoge.c& エディターによりソースプログラム作成 gcc -o fuga

More information

PowerPoint Presentation

PowerPoint Presentation p.130 p.198 p.208 2 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i i < NUM; i++ ) ) if if ( weight[i] > max ) max = weight[i]: if if ( weight[i] < min ) min = weight[i]: weight

More information

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D 6 2019 5 14 6.1 Minimum C....................... 6 1 6.2....................................... 6 7 6.1 Minimum C Minimum C BNF T okenseq W hite Any Digit ::= 0 1 2... 9. Number ::= Digit Digit. Alphabet

More information

‚æ4›ñ

‚æ4›ñ ( ) ( ) ( ) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 (OUS) 9 26 1 / 28 ( ) ( ) ( ) A B C D Z a b c d z 0 1 2 9 (OUS) 9

More information

WinHPC ppt

WinHPC ppt MPI.NET C# 2 2009 1 20 MPI.NET MPI.NET C# MPI.NET C# MPI MPI.NET 1 1 MPI.NET C# Hello World MPI.NET.NET Framework.NET C# API C# Microsoft.NET java.net (Visual Basic.NET Visual C++) C# class Helloworld

More information

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

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

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 >=

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 >= II 14 2018 7 26 : : proen@mm.ics.saitama-u.ac.jp 14,, 8 2 12:00 1 O(1) n O(n) O(log n) O(1) 32 : 1G int 4 250 M 2.5 int 21 2 0 100 0 100 #include #define HASHSIZE 100 /* */ #define NOTFOUND 0

More information

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

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます.  このサンプルページの内容は, 新装版 1 刷発行時のものです. C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. http://www.morikita.co.jp/books/mid/009383 このサンプルページの内容は, 新装版 1 刷発行時のものです. i 2 22 2 13 ( ) 2 (1) ANSI (2) 2 (3) Web http://www.morikita.co.jp/books/mid/009383

More information

P05.ppt

P05.ppt 2 1 list0415.c forfor #include int i, j; for (i = 1; i

More information

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

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 II 8 2003 11 12 1 6 ( ) 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 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko

More information

101NEO資料

101NEO資料 Version 1.5 Tutorial PDF ... 1. PDF... 2 -.... 2 -. PDF... 2 -.... 4 -. HTML... 4 -. PDF... 5 -.... 7 -.... 8 Tutorial PDF Tutorial PDF - Page 1 Tutorial PDF - Page 2 Tutorial PDF - Page 3 Tutorial PDF

More information

ohp08.dvi

ohp08.dvi 19 8 ( ) 2019.4.20 1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: 2 (2) NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( 2) 3 (3) head cur tail head cur prev data

More information

Ⅰ Report#1 Report#1 printf() /* Program : hello.c Student-ID : 095740C Author UpDate Comment */ #include int main(){ : Yuhi,TOMARI : 2009/04/28(Thu) : Used Easy Function printf() 10 printf("hello,

More information

C C UNIX C ( ) 4 1 HTML 1

C C UNIX C ( ) 4 1 HTML 1 C 2007 4 18 C UNIX 1 2 1 1.1 C ( ) 4 1 HTML 1 はじめ mkdir work 作業用ディレクトリーの作成 emacs hoge.c& エディターによりソースプログラム作成 gcc -o fuga hoge.c コンパイルにより機械語に変換 コンパイルエラー./fuga 実行 実行時エラー 完成 1: work hooge.c fuga 1 4 4 1 1.

More information

導入基礎演習.ppt

導入基礎演習.ppt Multi-paradigm Programming Functional Programming Scheme Haskell ML Scala X10 KL1 Prolog Declarative Lang. C Procedural Lang. Java C++ Python Object-oriented Programming / (root) bin home lib 08 09

More information

Ruby Ruby ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( ) 44=>

Ruby Ruby ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( ) 44=> Ruby Ruby 200779 ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( 2+3+4+5+6+7+8+9 ) 44 irb(main):002:0> irb irb(main):001:0> 1+2+3+4 => 10 irb(main):002:0>

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

More information

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225 Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1

More information

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

新・明解C言語で学ぶアルゴリズムとデータ構造 第 1 章 基本的 1 n 141 1-1 三値 最大値 algorithm List 1-1 a, b, c max /* */ #include int main(void) { int a, b, c; int max; /* */ List 1-1 printf("\n"); printf("a"); scanf("%d", &a); printf("b"); scanf("%d",

More information

1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1....................................

1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1.................................... 06H082 1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1..................................... 4 3.2 GP.....................................

More information

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

MPI MPI MPI.NET C# MPI Version2

MPI MPI MPI.NET C# MPI Version2 MPI.NET C# 2 2009 2 27 MPI MPI MPI.NET C# MPI Version2 MPI (Message Passing Interface) MPI MPI Version 1 1994 1 1 1 1 ID MPI MPI_Send MPI_Recv if(rank == 0){ // 0 MPI_Send(); } else if(rank == 1){ // 1

More information

ex12.dvi

ex12.dvi 1 0. C, char., char, 0,. C, ("),., char str[]="abc" ; str abc.,, str 4. str 3. char str[10]="abc" ;, str 10, str 3., char s[]="abc", t[10] ;, t = s. ASCII, 0x00 0x7F, char., "abc" 3, 1. 1 8 256, 2., 2

More information

double 2 std::cin, std::cout 1.2 C fopen() fclose() C++ std::fstream 1-3 #include <fstream> std::fstream fout; int a = 123; fout.open( "data.t

double 2 std::cin, std::cout 1.2 C fopen() fclose() C++ std::fstream 1-3 #include <fstream> std::fstream fout; int a = 123; fout.open( data.t C++ 1 C C++ C++ C C C++ 1.1 C printf() scanf() C++ C 1-1 #include int a; scanf( "%d", &a ); printf( "a = %d\n", a ); C++ 1-2 int a; std::cin >> a; std::cout

More information

Microsoft PowerPoint - 計算機言語 第7回.ppt

Microsoft PowerPoint - 計算機言語 第7回.ppt 計算機言語第 7 回 長宗高樹 目的 関数について理解する. 入力 X 関数 f 出力 Y Y=f(X) 関数の例 関数の型 #include int tasu(int a, int b); main(void) int x1, x2, y; x1 = 2; x2 = 3; y = tasu(x1,x2); 実引数 printf( %d + %d = %d, x1, x2, y);

More information

pptx

pptx iphone 2010 8 18 C xkozima@myu.ac.jp C Hello, World! Hello World hello.c! printf( Hello, World!\n );! os> ls! hello.c! os> cc hello.c o hello! os> ls! hello!!hello.c! os>./hello! Hello, World!! os>! os>

More information

RHEA key

RHEA key 2 P (k, )= k e k! 3 4 Probability 0.4 0.35 0.3 0.25 Poisson ( λ = 1) Poisson (λ = 3) Poisson ( λ = 10) Poisson (λ = 20) Poisson ( λ = 30) Gaussian (µ = 1, s = 1) Gaussian ( µ = 3, s = 3) Gaussian (µ =

More information

卒 業 研 究 報 告.PDF

卒 業 研 究 報 告.PDF C 13 2 9 1 1-1. 1-2. 2 2-1. 2-2. 2-3. 2-4. 3 3-1. 3-2. 3-3. 3-4. 3-5. 3-5-1. 3-5-2. 3-6. 3-6-1. 3-6-2. 4 5 6 7-1 - 1 1 1-1. 1-2. ++ Lisp Pascal Java Purl HTML Windows - 2-2 2 2-1. 1972 D.M. (Dennis M Ritchie)

More information

1 2 3 4 5 6 X Y ABC A ABC B 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 13 18 30 P331 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 ( ) 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59

More information

26 2 3 4 5 8 9 6 7 2 3 4 5 2 6 7 3 8 9 3 0 4 2 4 3 4 4 5 6 5 7 6 2 2 A B C ABC 8 9 6 3 3 4 4 20 2 6 2 2 3 3 4 4 5 5 22 6 6 7 7 23 6 2 2 3 3 4 4 24 2 2 3 3 4 4 25 6 2 2 3 3 4 4 26 2 2 3 3 27 6 4 4 5 5

More information

mogiJugyo_slide_full.dvi

mogiJugyo_slide_full.dvi a 2 + b 2 = c 2 (a, b, c) a 2 a 2 = a a a 1/ 78 2/ 78 3/ 78 4/ 78 180 5/ 78 http://www.kaijo.ed.jp/ 6/ 78 a, b, c ABC C a b B c A C 90 a 2 + b 2 = c 2 7/ 78 C a b a 2 +b 2 = c 2 B c A a 2 a a 2 = a a 8/

More information

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1:

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1: 005 9 7 1 1.1 1 Hello World!! 5 p r i n t f ( H e l l o World!! \ n ) ; 7 return 0 ; 8 } 1: 1 [ ] Hello World!! from Akita National College of Technology. 1 : 5 p r i n t f ( H e l l o World!! \ n ) ;

More information

±é½¬£²¡§£Í£Ð£É½éÊâ

±é½¬£²¡§£Í£Ð£É½éÊâ 2012 8 7 1 / 52 MPI Hello World I ( ) Hello World II ( ) I ( ) II ( ) ( sendrecv) π ( ) MPI fortran C wget http://www.na.scitec.kobe-u.ac.jp/ yaguchi/riken2012/enshu2.zip unzip enshu2.zip 2 / 52 FORTRAN

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

EPSON VP-1200 取扱説明書

EPSON VP-1200 取扱説明書 4020178-01 w p s 2 p 3 4 5 6 7 8 p s s s p 9 p A B p C 10 D p E 11 F G H H 12 p G I s 13 p s A D p B 14 C D E 15 F s p G 16 A B p 17 18 s p s 19 p 20 21 22 A B 23 A B C 24 A B 25 26 p s p s 27 28 p s p

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

H27 28 4 1 11,353 45 14 10 120 27 90 26 78 323 401 27 11,120 D A BC 11,120 H27 33 H26 38 H27 35 40 126,154 129,125 130,000 150,000 5,961 11,996 6,000 15,000 688,684 708,924 700,000 750,000 1300 H28

More information

main

main 14 1. 12 5 main 1.23 3 1.230000 3 1.860867 1 2. 1988 1925 1911 1867 void JPcalendar(int x) 1987 1 64 1 1 1 while(1) Ctrl C void JPcalendar(int x){ if (x > 1988) printf(" %d %d \n", x, x-1988); else if(x

More information

ohp03.dvi

ohp03.dvi 19 3 ( ) 2019.4.20 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void int main(int argc, char *argv[]) {... 2 (2) argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0

More information

Microsoft Word - Training10_プリプロセッサ.docx

Microsoft Word - Training10_プリプロセッサ.docx Training 10 プリプロセッサ 株式会社イーシーエス出版事業推進委員会 1 Lesson1 マクロ置換 Point マクロ置換を理解しよう!! マクロ置換の機能により 文字列の置き換えをすることが出来ます プログラムの可読性と保守性 ( メンテナンス性 ) を高めることができるため よく用いられます マクロ置換で値を定義しておけば マクロの値を変更するだけで 同じマクロを使用したすべての箇所が変更ができるので便利です

More information

Java updated

Java updated Java 2003.07.14 updated 3 1 Java 5 1.1 Java................................. 5 1.2 Java..................................... 5 1.3 Java................................ 6 1.3.1 Java.......................

More information

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

Microsoft PowerPoint - C言語の復習(配布用).ppt [互換モード] if 文 (a と b の大きい方を表示 ) C 言語 Ⅰ の復習 条件判定 (if, 条件式 ) ループ (for[ 二重まで ], while, do) 配列 ( 次元 次元 ) トレース int a, b; printf( 整数 a: ); scanf( %d, &a); printf( 整数 b: ); scanf( %d, &b); //つのif 文で表現する場合間違えやすい どっちに =

More information

2 Eclipse 2.1 Eclipse 1. Eclipse 2. 3 ( 4) E:Yworkspace OK 3 Eclipse 4 3. Eclipse 5 5 Eclipse Eclipse 2. 7 C 2

2 Eclipse 2.1 Eclipse 1. Eclipse 2. 3 ( 4) E:Yworkspace OK 3 Eclipse 4 3. Eclipse 5 5 Eclipse Eclipse 2. 7 C 2 3: 1 1. PC 2. Phantasys 201209 ( 1) 1 PC 2 Windows 3. Windows ID ( 2) 4. Web (Firefox Internet Explorer) 5. A 6. http:// http://www.cv.ics.saitama-u.ac.jp/yosinori/lecture/seminar/ Web 1 7. USB PC USB

More information

Condition DAQ condition condition 2 3 XML key value

Condition DAQ condition condition 2 3 XML key value Condition DAQ condition 2009 6 10 2009 7 2 2009 7 3 2010 8 3 1 2 2 condition 2 3 XML key value 3 4 4 4.1............................. 5 4.2...................... 5 5 6 6 Makefile 7 7 9 7.1 Condition.h.............................

More information

Microsoft PowerPoint - CproNt11.ppt [互換モード]

Microsoft PowerPoint - CproNt11.ppt [互換モード] 第 11 章入出力関数とライブラリ関数 CPro:11-01 概要 getchar putchar gets puts scanf printf strcat strcmp strcpy strlen atoi atof sprint sscanf 11.1 コンソール入出力関数 11-02 入力 出力 getchar putchar 一文字 gets puts 文字列 ( 一行 ) scanf printf

More information

XMPによる並列化実装2

XMPによる並列化実装2 2 3 C Fortran Exercise 1 Exercise 2 Serial init.c init.f90 XMP xmp_init.c xmp_init.f90 Serial laplace.c laplace.f90 XMP xmp_laplace.c xmp_laplace.f90 #include int a[10]; program init integer

More information

& & a a * * ptr p int a ; int *a ; int a ; int a int *a

& & a a * * ptr p int a ; int *a ; int a ; int a int *a int a = 123; a 123 :100 a 123 int *ptr = & a; a ptr ptr a 100 a 123 200 *ptr 200 a & & a a * * ptr p --------------------------------------------------------------------------------------------- int a

More information

2011.12.3 1 2 Q) A) 3 Q) A) 4 5 6 Haskell 7 8 Parser data Parser a = Parser (String -> [(a,string)]) Parser pwrap :: a -> Parser a pwrap v = Parser $ \inp -> [(v,inp)] Parser pbind :: Parser a -> (a ->

More information

C V C 6 1 6.1.............................. 1 6.......................... 3 6.3..................... 5 6.4 NULL............................. 8 6.5......................... 9 6.6..............................

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() 2 double *a[ ]; double 1 malloc() double 1 malloc() free() 3 #include #include

More information

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

EOS 70D (W) Wi-Fi機能 使用説明書

EOS 70D (W) Wi-Fi機能 使用説明書 EOS 70D (W) J 2 z q l D w 3 z q l D 4 w 5 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 1 2 3 4 8 5 6 7 8 9 9 10 11 12 13 14 10 11 1 5 0 2 V 0 B 3 5 0 B 12 4 5 M 0 B 13 Q U V U 0 0 L M B 14 5 5 5 15 5 16 5 5 17

More information

文字列操作と正規表現

文字列操作と正規表現 文字列操作と正規表現 オブジェクト指向プログラミング特論 2018 年度只木進一 : 工学系研究科 2 文字列と文字列クラス 0 個以上の長さの文字の列 Java では String クラス 操作 文字列を作る 連結する 文字列中に文字列を探す 文字列中の文字列を置き換える 部分文字列を得る 3 String クラス 文字列を保持するクラス 文字列は定数であることに注意 比較に注意 == : オブジェクトとしての同等性

More information

Version C 1 2 3 4 5 1 2 3 4 5 6 7 8 9 0 A 1 2 1 3 4 5 1 1 2 1 1 1 2 4 5 6 7 8 3 1 2 C a b c d e f g A A B C B a b c d e f g 3 4 4 5 6 7 8 1 2 a b 1 2 a b 1 2 1 2 5 4 1 23 5 6 6 a b 1 2 e c d 3

More information

新たな基礎年金制度の構築に向けて

新たな基礎年金制度の構築に向けて [ ] 1 1 4 60 1 ( 1 ) 1 1 1 4 1 1 1 1 1 4 1 2 1 1 1 ( ) 2 1 1 1 1 1 1 1996 1 3 4.3(2) 1997 1 65 1 1 2 1/3 ( )2/3 1 1/3 ( ) 1 1 2 3 2 4 6 2.1 1 2 1 ( ) 13 1 1 1 1 2 2 ( ) ( ) 1 ( ) 60 1 1 2.2 (1) (3) ( 9

More information

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

[1] #include<stdio.h> main() { printf(hello, world.); return 0; } (G1) int long int float ± ± [1] #include printf("hello, world."); (G1) int -32768 32767 long int -2147483648 2147483647 float ±3.4 10 38 ±3.4 10 38 double ±1.7 10 308 ±1.7 10 308 char [2] #include int a, b, c, d,

More information

48 * *2

48 * *2 374-1- 17 2 1 1 B A C A C 48 *2 49-2- 2 176 176 *2 -3- B A A B B C A B A C 1 B C B C 2 B C 94 2 B C 3 1 6 2 8 1 177 C B C C C A D A A B A 7 B C C A 3 C A 187 187 C B 10 AC 187-4- 10 C C B B B B A B 2 BC

More information

P06.ppt

P06.ppt p.130 p.198 p.208 2 1 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i < NUM; i++ ) if ( weight[i] > max ) max = weight[i]: if ( weight[i] < min ) min = weight[i]: weight 3 maxof(a,

More information

Java プログラミング Ⅰ 3 回目変数 変数 変 数 一時的に値を記憶させておく機能型 ( データ型 ) と識別子をもつ 2 型 ( データ型 ) 変数の種類型に応じて記憶できる値の種類や範囲が決まる 型 値の種類 値の範囲 boolean 真偽値 true / false char 2バイト文

Java プログラミング Ⅰ 3 回目変数 変数 変 数 一時的に値を記憶させておく機能型 ( データ型 ) と識別子をもつ 2 型 ( データ型 ) 変数の種類型に応じて記憶できる値の種類や範囲が決まる 型 値の種類 値の範囲 boolean 真偽値 true / false char 2バイト文 Java プログラミング Ⅰ 3 回目変数 変数 変 数 一時的に値を記憶させておく機能型 ( データ型 ) と識別子をもつ 2 型 ( データ型 ) 変数の種類型に応じて記憶できる値の種類や範囲が決まる 型 値の種類 値の範囲 boolean 真偽値 true / false char 2バイト文字 0x0000 ~ 0xffff byte 1バイト整数 - 2 8 ~ 2 8-1 short 2バイト整数

More information

2 3

2 3 Sample 2 3 4 5 6 7 8 9 3 18 24 32 34 40 45 55 63 70 77 82 96 118 121 123 131 143 149 158 167 173 187 192 204 217 224 231 17 285 290 292 1 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

More information

tuat1.dvi

tuat1.dvi ( 1 ) http://ist.ksc.kwansei.ac.jp/ tutimura/ 2012 6 23 ( 1 ) 1 / 58 C ( 1 ) 2 / 58 2008 9 2002 2005 T E X ptetex3, ptexlive pt E X UTF-8 xdvi-jp 3 ( 1 ) 3 / 58 ( 1 ) 4 / 58 C,... ( 1 ) 5 / 58 6/23( )

More information

02: 変数と標準入出力

02: 変数と標準入出力 C プログラミング入門 基幹 7 ( 水 5) 09: ポインタ 文字列 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/teachers/w 483692/CPR/ 207-06-4 関数できなかったこと 2 配列を引数として渡す, 戻り値として返す 文字列を扱う 呼び出し元の変数を直接書き換える 例 : 2 つの変数の値を入れ替える関数

More information

untitled

untitled II 4 Yacc Lex 2005 : 0 1 Yacc 20 Lex 1 20 traverse 1 %% 2 [0-9]+ { yylval.val = atoi((char*)yytext); return NUM; 3 "+" { return + ; 4 "*" { return * ; 5 "-" { return - ; 6 "/" { return / ; 7 [ \t] { /*

More information

(300, 150) 120 getchar() HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgO

(300, 150) 120 getchar() HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgO Handy Graphic for Handy Graphic Version 0.5 2008-06-09 1 Handy Graphic Handy Graphic C Handy Graphic Handy Graphic Mac OS X Handy Graphic HgDisplayer Handy Graphic HgDisplayer 2 Handy Graphic 1 Handy Graphic

More information

関数 C 言語は関数の言語 関数とは 関数の定義 : f(x) = x * x ; 使うときは : y = f(x) 戻り値 引数

関数 C 言語は関数の言語 関数とは 関数の定義 : f(x) = x * x ; 使うときは : y = f(x) 戻り値 引数 関数 C 言語は関数の言語 関数とは 関数の定義 : f(x) = x * x ; 使うときは : y = f(x) 戻り値 引数 関数の定義 戻り値の型 関数名 引数の型 引数の名前 int funcname ( int a, char b) { int c ; c = a * b ; return c ; 引数の型 引数の名前 戻り値 戻り値の型は int 変数 c の型も int return

More information

橡Pro PDF

橡Pro PDF 1 void main( ) char c; /* int c; */ int sum=0; while ((c = getchar())!= EOF) if(isdigit(c) ) sum += (c-'0'); printf("%d\n", sum); main()int i,sum=0; for(i=0;i

More information

ポインタ変数

ポインタ変数 プログラミング及び実習 5 馬青 1 文字処理 数値処理 : 整数 浮動小数点数 単一の文字は と ( シングルクォーテーション ) で囲んで表現される 文字のデータ型は char または int である int を用いたほうが ライブラリの関数の引数の型と一致する 以下は全部 int の使用に統一する 従って int ch; で文字変数を宣言しておくと ch= A ; のように ch に文字 A

More information

ファイル入出力

ファイル入出力 C プログラミング Ⅱ の基礎 とは ファイルへデータを書き込んだり ( 出力 ), ファイルからデータを読み込んだり ( 入力 ) する C 言語では キーボードからの入力 画面への出力と同じようなコードで 処理を実現できる プログラム 入力 出力 ファイル 出力 入力 2 入出力の基本 ストリーム プログラム上で様々な装置への入出力を行う機構様々な入出力装置を統一的な方法で扱うことができる ハードディスクなどではファイルデータによって入出力が行われる

More information