Informatics 2010.key

Similar documents
Informatics 2014

Informatics 2015

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

超初心者用

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

C C UNIX C ( ) 4 1 HTML 1

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

P05.ppt

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

導入基礎演習.ppt

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

スパコンに通じる並列プログラミングの基礎

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2

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

スパコンに通じる並列プログラミングの基礎


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

tuat1.dvi

‚æ4›ñ

スパコンに通じる並列プログラミングの基礎

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

PowerPoint プレゼンテーション

LAN Copyright c Daikoku Manabu This tutorial is licensed under a Creative Commons Attribution 2.1 Japan License

273? C

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i )

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

Microsoft Word J.^...O.|Word.i10...j.doc

ex01.dvi

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

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡

joho09.ppt

untitled

untitled

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 新装版 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) + x * x + x x (4) * *


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

untitled

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

tebiki00.dvi



ex01.dvi

pptx

10

K227 Java 2

新版明解C言語 実践編

3.1 stdio.h iostream List.2 using namespace std C printf ( ) %d %f %s %d C++ cout cout List.2 Hello World! cout << float a = 1.2f; int b = 3; cout <<

(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

USB ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231

PowerPoint Presentation

EDSF2006_ PDF

book

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

kiso2-09.key

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return 0; 戻り値 1: main() 2.2 C main

I #2 : ( 8-13), () URL : j inoue/prog2007/prog2007.html

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

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

: CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and Technology

GNU Emacs GNU Emacs

新・明解C言語 ポインタ完全攻略

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

programmingII2019-v01

Cプログラミング1(再) 第2回

2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java


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

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

Taro-最大値探索法の開発(公開版

DOPRI5.dvi

2008 IIA (program) pro(before)+gram(write) (artificial language) (programming languege) (programming) (machine language) (assembly language) ( )

1 4 2 EP) (EP) (EP)

ohp03.dvi

kiso2-03.key

10/8 Finder,, 1 1. Finder MAC OS X 2. ( ) MAC OS X Java ( ) 3. MAC OS X Java ( ) / 10

For_Beginners_CAPL.indd

プログラミング基礎

1st-session key

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

Łñ“’‘‚2004

プリント


joho07-1.ppt

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

11042 計算機言語7回目 サポートページ:

C B

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

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

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in

Taro-数値計算の基礎Ⅱ(公開版)


P06.ppt

1.1 1 C IIA $ cd comp3a %endminipage ~/comp3a mkdir $ mkdir comp3a $ cd comp3a C.c Emacs Cntrol x Control s 2 Emacs Control-x Control-f Control-

Java updated

2008 DS T050049

Gauss

C ( ) C ( ) C C C C C 1 Fortran Character*72 name Integer age Real income 3 1 C mandata mandata ( ) name age income mandata ( ) mandat

Linux XScreenSaver T020074

comment.dvi

Transcription:

http://math.sci.hiroshima-u.ac.jp/ ~ryo/lectures/informatics2010/ 1 2 C ATM etc. etc. (Personal Computer) 3 4

Input Output Device Central Processing Unit I/O CPU Memory 5 6 (CPU),,... etc. C, Java, Fortran... etc. CPU CPU 7 8

.bashrc Src u012345 Desktop / fs a.out prog.c Exec Mihon Src Informatics hello.c a.out home1 ryokoba bin Mihon home2 u012345 Desktop ~...../.. Exec Src Informatics./a.out a.out /home/user2/ryokoba/mihon/src../../bin 9 10 GUI Graphical User Interface GUI GUI GUI cd + ls & rm 11 12

ls : $ ls -l : ls pwd : cd : $ cd ~/Informatics/Mihon $ cd../.. $ cd ~ mkdir : $ mkdir New New cp : $ cp source_file target_file target_file source_file $ cp source_file target_directory target_directory source_file mv : $ mv source_file target_file source_file target_file $ mv source_file target_directory target_directory source_file rm : rm 13 14 Unixvi, emacs,... gedit MacXcode, mi,... Windows, TeraPad,... C #include <stdio.h> int main(void) {!... }... C printf( ) main( ) ( ) main 15 16

hello.c C hello.c a.out $ cc hello.c $./a.out a.out #include <stdio.h> int main(void) {! printf( Hello!!\n ); } printf( ) Tab Key 17 18 1 0 0 1 0 1 1 0 2 8 = 256 2 10 =1024 1K 19 C int, unsigned int, long, unsigned long, short, unsigned short, float, double char, unsigned char 2 2. 2.0 20

int a; a int a 2 int a int 2 a int a; double x; double x size_of_variables.c 21 22 C =, Ex. C C == 23 24

int a; int a = 0; initialize.c 25 substitution.c swap.c 26 swap1.c 2 swap2.c output_values.c 27 28

printf("input a: "); scanf("%d", &a); & double %f %lf input_values.c a, b 3 swap3.c! 29 30 int double int int int double 3/5 0.6 double double double type1.c, type2.c 1. values1.c 2. values2.c 31 32

(i) 33 (ii) 34 C 35 > < = 36

(true) (false) > == >!= comparison.c 37 38 and or not logical_operator.c 39 if 40

if even_odd.c 1. max_of_two 2. 3. common_multiple x = 2, y = 3 absolute_value 41 42 max_of_two common_multiple 43 44

common_multiple absolute_value 45 46 intercalary_year 100 400 = + 4 100 400 = 365.24219 40097 1 97.0/400=0.2425 47 48

if if_in_if.c if { } if (indent) max_of_three 49 50 (iii) for 51 52

for print_counter.c 53 for 54 for sum_up2 sum_up 55 print_double_counter.c 56

kuku indian_kuku chess_board 57 58 while while square.c 59 60

while print_counter.c while for_by_while sum_over judge_prime (1) for_by_while.c 61 62 (2) sum_over.c (2) sum_over.c 63 64

i 65 66 gcd(x, y) x, y (greatest common divisor) 0 gcd(x, y) = gcd(y, x%y) gcd(x, 0) = x gcd(20, 14) = gcd(14, 6) = gcd(6, 2) = gcd(2, 0) = 2 y Ex. gcd(x, y) = gcd(y, x%y) x = py + q p q x x y y (0 q<y) y, q x x, y q = x py x, y q y, q x, y = y, q gcd(x, y) = gcd(y, q) 67 68

y x x, y y gcd(20, 14) = gcd(14, 6) = gcd(6, 2) = gcd(2, 0) = 2 14 20 2 2. euclid 69 70 71 (array) int int 72

set_array.c set_array2 random_number.c 73 #include <stdio.h> int main(void) {! int x[5], i;! for (i = 0; i < 5; i++)! {!! x[i] = i * i;! }! printf("data of the array x\n");! for (i = 0; i < 5; i++)! {!! printf("x[%d] = %d\n", i, x[i]);! } } define #include <stdio.h> #define N 5 int main(void) {! int x[n], i;! for (i = 0; i < N; i++)! {!! x[i] = i * i;! }! printf("data of the array x\n");! for (i = 0; i < N; i++)! {!! printf("x[%d] = %d\n", i, x[i]);! } } 74 rand() srand(seed) seed 75 76

Mihon/Src/max_of_array.c max_of_array table_of_primes statistics m = 1 N x i V = 1 N (x i m) 2 σ = V N N i=1 i=1 x #include <math.h> 77 78 #include <stdio.h> #include <glsc.h> int main(void) {! double x_window = 100.0, y_window = 100.0;! g_init("graph", x_window, y_window);! g_device(g_disp);! g_sleep(2.0);! g_term(); } ex0.c 79 80

(0, 0) x_std g_def_scale(scale_number, x_left, x_right, y_bottom, y_top,! x_left_std, y_top_std, x_width_std, y_width_std); x_left x_right y_top y_top_std y_width_std y_std x_left_std x_width_std (x_window, y_window) y_bottom 81 82 g_init("graph", x_window, y_window); g_device(g_disp); g_def_scale(0, x_left, x_right, y_bottom, y_top, x_left_std, y_top_std, x_width_std, y_width_std); g_cls(); g_sel_scale(0); g_box(0.0, 1.0, 0.0, 1.0, G_YES, G_NO); g_move(0.5, 0.0); g_plot(1.0, 1.0); g_plot(0.0, 0.5); g_plot(0.5, 0.0); color g_sleep(g_stop); g_term(); g_line_color(color); g_area_color(color); 83 84

g_line_width(width); width g_line_type(type); type g_text(x_std, y_std, Hello ); 85 86 y (x i,y i ) x (x i,y i ) y i y y = f(x) y = f(x) x i x x i = x 0 + i x (i =0, 1,,I) y i = f(x i ) (x i,y i ) (x i,y i ) f(x i ) 87 88