5-2 print(i, "\n") print("-- while--\n") while i < 2 j = print(i, ",", j, "\n") print("-- while--\n") while j < 3 print(i, ",", j, "\n") j = j + 1 pri

Size: px
Start display at page:

Download "5-2 print(i, "\n") print("-- while--\n") while i < 2 j = print(i, ",", j, "\n") print("-- while--\n") while j < 3 print(i, ",", j, "\n") j = j + 1 pri"

Transcription

1 I print(i, "\n") print("-- while--\n") while i < 3 print(i, "\n") print("-- while--\n") print(i, "\n") 1

2 5-2 print(i, "\n") print("-- while--\n") while i < 2 j = print(i, ",", j, "\n") print("-- while--\n") while j < 3 print(i, ",", j, "\n") j = j + 1 print("-- while--\n") print(i, ",", j, "\n") print("-- while--\n") print(i, ",", j, "\n") 5-3 yasun_neta yasu_neta yasu_neta = Hash.new kappa 12 while i < 4 print("? >") neta = gets.chomp print("? >") kakaku = gets.chomp.to_i if kakaku < 3 yasu_neta[neta] = kakaku uni 3 ohtoro 65 anago 2 2

3 3 5-4 ( ) 1: i = 1 2: j = 1 3: while i <= 9 4: while j <= 9 5: print(i * j) 6: j = j + 1 7: 8: print("\n") 9: 1: i j i j i(=1) 9 i<= j(=1) 9 j<=9 5, i * j j j(=2) 9 j<=9 5, i j j j(=9) 9 j<=9 5, i * j

4 i j print i, j i = 1 j = 1 while i <= 9 print("a ", i, ":", j, "\n") # <=== while j <= 9 print("b ", i, ":", j, "\n") # <=== # print(i * j) # <=== j = j + 1 print("\n") 5-5 apple 8 7 persimmon 5 1: kakaku_list = {"apple" => 1, "" => 5, "banana" => 8} 2: 3: 4: while i < 5 5: print("?> ") 6: kudamono = gets.chomp 7: print("?> ") 8: kakaku = gets.chomp.to_i 9: 1: if kakaku_list[kudamono] > kakaku 11: kakaku_list[kudamono] = kakaku 12: else 13: print(" \n") 14: 15: 16: 17: 18: # 19: kakaku_list.each { key, value 2: print(key, " ", value, " \n") 21: } 4

5 kakaku list key value i 1 kudamono kakaku key value apple 8 1 > 8 true 1 7 kakaku_list["apple"] 8 apple 8 banana apple banana 2 persimmon 5 apple banana 3.1 ruby OK 5

6 ruby 2 # age age = gets.chomp if # 2 print(" OK \n") else # print(" \n") 5-7 (A, B, C, D) ruby ruby 6

7 4 5-8 Z:\progI>ruby prog.rb > output.txt > prog.rb ruby output.txt prog.rb output.txt Meadow 5-9 # 5 fruit_list = Array.new(5, "") # while i < 5 print(" > ") fruit = gets.chomp if fruit == "." break fruit_list[i] = fruit # print("\n") print(" \n") while i < fruit_list.size print(fruit_list[i], "\n") print(" \n") 7

8 1 1 apple grape peach pear 2 fruit.rb fruit_list.txt Z:\progI>ruby fruit.rb < fruit_list.txt? apple grape peach pear persimmon strawberry banana mango kiwi. 8

9 5-11 fruit_price_table = Hash.new() while i < 5 print(" > ") fruit = gets.chomp if fruit == "." break print(" > ") price = gets.chomp.to_i fruit_price_table[fruit] = price print("\n") print(" \n") fruit_price_table.each{ fruit, price print(fruit, " ", price, " \n") } print(" \n") apple 2 5 grape 25 peach 28 pear 13 9

10 2 gets < [ ]: gets II while i < 1 print(" \n") Z:\progI>ruby program6-13.rb > output.txt 5-14 owari = "" while i < 1 nyuryoku = gets.chomp owari = owari + nyuryoku print(owari, "\n") 1

11 output.txt Z:\progI>ruby program6-14.rb < output.txt 5-15 output2.txt? Z:\progI>ruby program6-15.rb < output.txt > output2.txt % 3 1 uni 1 kani 8 oni 5 tani 7 saru 13 kani 8 usu 5 11

1 Ex Ex. 2 2

1 Ex Ex. 2 2 I 20 100 85 40 85 PDF Windows TA ruby TA6 2 8 1. 2. PDF 3. PDF 1 Ex. 1 2 2 Ex. 2 2 2 Ex. 3 seisu = Array.new(3, 0) seisu[0] = gets.chomp.to_i seisu[1] = gets.chomp.to_i seisu[2] = gets.chomp.to_i wa =

More information

Ruby 50 Ruby UTF print, \n [Ruby-1] print("hello, Ruby.\n") [Ruby-2] Hello, Ruby. [Ruby-3] print("hello, \"Ruby\".\n") 2 [Ruby-4] seisuu = 10 pr

Ruby 50 Ruby UTF print, \n [Ruby-1] print(hello, Ruby.\n) [Ruby-2] Hello, Ruby. [Ruby-3] print(hello, \Ruby\.\n) 2 [Ruby-4] seisuu = 10 pr Ruby 50 Ruby UTF-8 1 1 print, \n [Ruby-1] print("hello, Ruby.\n") [Ruby-2] Hello, Ruby. [Ruby-3] print("hello, \"Ruby\".\n") 2 [Ruby-4] seisuu = 10 print(seisuu, "\n") jissuu = 3.141592 print(jissuu, "\n")

More information

I 1 1 ( *) ( *) ex1-1.rb ) 2 CGI

I 1 1 ( *) ( *) ex1-1.rb ) 2 CGI I 1 1 ( *) ( *) ex1-1.rb ) 2 CGI 1-1 http://klis.tsukuba.ac.jp/klib/subjects/progi/example2018/ 1-1 1-2 http://klis.tsukuba.ac.jp/klib/subjects/progi/example2018/ 1-2 I \( ) ( ) 1 3 Ruby 1 1? 1-3 ( ) I

More information

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb " # $ % & ' ( ) * +, -. / 0 1 2 3 4 5 6 7 8 9 : ; < = >? @ 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 " # $ % & ' ( ) * + , -. / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B

More information

-34-

-34- -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- !!! -60- -61- -62- -63- ! -64- !

More information

Windows [ ] [ (R)..] cmd [OK] Z:\> mkdir progi [Enter] \ ) mkdir progi ) (command ) help [Enter] help ( help ) mkdir make directory Windows ) mkdir mk

Windows [ ] [ (R)..] cmd [OK] Z:\> mkdir progi [Enter] \ ) mkdir progi ) (command ) help [Enter] help ( help ) mkdir make directory Windows ) mkdir mk Ruby I I 1 Windows 1 Meadow 1: Meadow I Meadow 2 2 Ruby 2.1 I Z progi 1 Windows [ ] [ (R)..] cmd [OK] Z:\> mkdir progi [Enter] \ ) mkdir progi ) (command ) help [Enter] help ( help ) mkdir make directory

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション "# "# $%&' "#$% $# & $# $% % ' ()(*"#$% +,(- ()(*"#$%.' ()(* $/.0##'' %0$&0% 1*2#/0/%'&0343$56 789#/0/'%&04../ "3"0##"$ "0%0$" "7 1*2#.30///04%.$ 789#.30///0#$'4 http://www.ibie2016.com/exhibitorlist/

More information

橡Taro9-生徒の活動.PDF

橡Taro9-生徒の活動.PDF 3 1 4 1 20 30 2 2 3-1- 1 2-2- -3- 18 1200 1 4-4- -5- 15 5 25 5-6- 1 4 2 1 10 20 2 3-7- 1 2 3 150 431 338-8- 2 3 100 4 5 6 7 1-9- 1291-10 - -11 - 10 1 35 2 3 1866 68 4 1871 1873 5 6-12 - 1 2 3 4 1 4-13

More information

... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2

... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2 1 ... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2 3 4 5 6 7 8 9 Excel2007 10 Excel2007 11 12 13 - 14 15 16 17 18 19 20 21 22 Excel2007

More information

-----------------------------------------------------------------------------------------1 --------------------------------------------------------------------------------------1 -------------------------------------------------------------------------------------1

More information

›¼’à”v“lŠÍ1−ª

›¼’à”v“lŠÍ1−ª 3 1 1 2 3 4 5 6 7 8 8 10 12 14 16 18 20 22 24 2 1 2 3 4 5 6 7 8 9 10 11 12 26 28 30 32 34 36 38 40 42 44 46 48 50 4 3 1 2 3 4 5 52 54 56 58 60 6 62 7 8 9 10 64 66 68 70 72 5 1 1 4 2 5 6 6 7 1 8 1 9 2 10

More information

1 2 3 4 1 2 3 4 1 2 3 4 12 3 4

1 2 3 4 1 2 3 4 1 2 3 4 12 3 4 1 2 3 4 5 6 1 2 3 4 5 6 1 2 1 2 1 2 1 2 1 2 3 4 12 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 12 3 4 1 2 3 4 5 6 7 8 1 2 3 46 7 1 2 3 4 5 6 7 1 2 3 4 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 16 7 8 92 3 46 7 :

More information

- 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 2-12 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 1 - 2 - 3 6 1 1-4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 130 3 130 5 2 50 1.5 48 59 62 63-9 - 1 - 2 - 3 () - 4 - 5 -

More information

S1460...........\1.E4

S1460...........\1.E4 3 4 3 4 5 3 4 5 3 4 3 4 3 3 3 3 4 3 4 3 3 4 4 3 3 3 3 4 3 4 3 3 3 3 3 3 4 3 4 3 4 5 4 3 5 4 3 3 4 5 3 4 5 4 3 4 3 3 4 3 4 3 3 3 3 3 4 3 3 4! "! " " 0 6 ! " 3 4 3 3 4 3 ! " 3 3 4 5 4 5 6 3 3

More information

プログラム

プログラム !!!!!!!! !!!!!!! "! !!!!!!!!!! !!!!!! !! !! !!!! !! " " " !!!! !!! "!! !! " !! " !!!! !! "!!! !!!!!! " " !!!!!!!!!!!! !!!!!! ρ!!"! " " " " " " " " "!!! " " " " " " "!! "" !! !!!! "!! " "!! ρ !!!! " "!!

More information

http://banso.cocolog-nifty.com/ 100 100 250 5 1 1 http://www.banso.com/ 2009 5 2 10 http://www.banso.com/ 2009 5 2 http://www.banso.com/ 2009 5 2 http://www.banso.com/ < /> < /> / http://www.banso.com/

More information

ワードプロセッシングについて

ワードプロセッシングについて Word Word ONOFF (U)(P) ******** 1 OS Windows2000 Windows2000 (U) OK 2 Windows 3 Word 1) 2) (F)(O) A() FD(A) Word 4 1) / > < *.? " : ; 2) SAMPLE2 A SAMPLE2 5 .doc 6 Alt f6f9 7 + 8 ) 2) 9 1) 2) 1) 10 2)

More information

n=360 28.6% 34.4% 36.9% n=360 2.5% 17.8% 19.2% n=64 0.8% 0.3% n=69 1.7% 3.6% 0.6% 1.4% 1.9% < > n=218 1.4% 5.6% 3.1% 60.6% 0.6% 6.9% 10.8% 6.4% 10.3% 33.1% 1.4% 3.6% 1.1% 0.0% 3.1% n=360 0% 50%

More information

" " " " "!!

    !! ""!!!!! "! "! " " " " " " " "!! !!!!!!!!! ! !!!!! "β!"β"! " " "!! "! "!!! "!! !!! "! "!!!! "! !!!!! !!! " "!! "!!! " " "!!! ! "!! !!!!!!! " " " " "!! α!!!!! ! "! " " !!!!!!! "! ! ""!!!! !!!!!! " "! "!

More information

2

2 2 5 6 8 9 (1) (2) (3) 10 11 (1) (2) (3) 36 (1) (2) (3) (4) 37 (1) (2) (3) 42 3 4 3 24 3 3 3 20 59 20 33 20 18 3 25 3 5 3 19 21 3 22 10 16 6 23 4 1 24 3 31 1 1. 4 1 5 5 6 6 6 23 6 23 6 30 7 21 12 1 12 15

More information

項 目

項 目 1 1 2 3 11 4 6 5 7,000 2 120 1.3 4,000 04 450 < > 5 3 6 7 8 9 4 10 11 5 12 45 6 13 E. 7 B. C. 14 15 16 17 18 19 20 21 22 23 8 24 25 9 27 2 26 6 27 3 1 3 3 28 29 30 9 31 32 33 500 1 4000 0 2~3 10 10 34

More information

fp.gby

fp.gby 1 1 2 2 3 2 4 5 6 7 8 9 10 11 Haskell 12 13 Haskell 14 15 ( ) 16 ) 30 17 static 18 (IORef) 19 20 OK NG 21 Haskell (+) :: Num a => a -> a -> a sort :: Ord a => [a] -> [a] delete :: Eq a => a -> [a] -> [a]

More information

Microsoft PowerPoint - 20140203 Perl講習会.ppt [互換モード]

Microsoft PowerPoint - 20140203 Perl講習会.ppt [互換モード] 中 村 聡 史 1 12345の 約 数 の 数 を 数 えるプログラム int i = 1; int count = 0; while( i

More information

38

38 3 37 38 3.1. 3.1.1. 3.1-1 2005 12 5 7 2006 5 31 6 2 2006 8 10 11 14 2006 10 18 20 3.1-1 9 00 17 3 3.1.2. 3.1-2 3.1-1 9 9 3.1-2 M- M-2 M-3 N- N-2 N-3 S- S-2 S-3 3.1.2.1. 25 26 3.1.2.2. 3.1-3 25 26 39 3.1-1

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 12 of 14 ( RD S ) I 12 of 14 1 / 35 https://bit.ly/oitprog1 ( RD S ) I 12 of 14 2 / 35 game.rb ( RD S ) I 12 of 14 3 / 35 game.rb 11 ( ) 1 require "io/console"

More information

超簡単、売上入力画面作成

超簡単、売上入力画面作成 19 1 10 Access Access 1. Access [ ] < 1 > 2. Access [ ] 3. [ ] [ ] 4. < 2 > 1. [ ] [ ] [ ] [ ] [ ] 2. [ ] < 3 > 3. [ ] 4. [ ] [ ] 5. [ ] < 4 > [ ] Yes/No [ ] 6. < 5 > 1. [ ] [ ] 2. [ ] < 6 > 3. [ ] [ ]

More information

דוח דירקטוריון - חברה 012010 - גר 9 - 300510

דוח דירקטוריון - חברה 012010 - גר 9 - 300510 13060608060408 0704 0609030606 060705 050607 040007030501 0606070804060708 0300''6 1 6 1''06''6 1 0606050706010708 31.03.10 04010705 030902010105 0507090708 13050607 060705 060608060408 0704 0609030606

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション SumStock 1 .... 2 3 4 5 1 2 3 6 OK NO OK NO SUMSTOCK 7 8 : ( ( DIY 9 10 FGCDJHH 5 15 15 50 B. B. A B A B F G C D E H H I J + + F.. G A. B.. 11 C.. 5 12 D 100 10080 8060 6040 40 90 90150 150. J 13 H LDK

More information

untitled

untitled 280 200 5 7,800 6 8,600 28 1 1 18 7 8 2 ( 31 ) 7 42 2 / / / / / / / / / / 1 3 (1) 4 5 3 1 1 1 A B C D 6 (1) -----) (2) -- ()) (3) ----(). ()() () ( )( )( )( ) ( ) ( )( )( )( ) () (). () ()() 7 () ( ) 1

More information

血統詳細‐本番/3日目 482‐750

血統詳細‐本番/3日目 482‐750 2-1-, '($ # 10)*/.%- 345 " "!")* + +%& - #,'(%!! 3l 5h "%%%#%%%$ (% *)&' * &' +,- $!!! ""!!$!"" "#!!!""!!!""!! . 11 c %*) '( '(& %'(&+ %& -'( $!"! $, ###$ $, " #$ #"! "#!! + 14 a %& *) *'%&$ * ", "!" "

More information

Ruby演習テキスト1

Ruby演習テキスト1 Ruby言語 基礎演習 社会人技術者研修 2014年度 テキスト 社会人技術者研修 2014年度テキスト 2014.11 Ruby基礎演習 1 2014.11 2015.2.1 puts "Hello Ruby >ruby hello.rb ( リターン ) > ruby hello.rb Hello Ruby # はじめての ruby プログラム puts "Hello Ruby" > ruby

More information

コーディング基準.PDF

コーディング基準.PDF Java Java Java Java.java.class 1 private public package import / //////////////////////////////////////////////////////////////////////////////// // // // // ////////////////////////////////////////////////////////////////////////////////

More information

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

More information

untitled

untitled i ii (1) (1) (2) (1) (3) (1) (1) (2) (1) (3) (1) (1) (2) (1) (3) (2) (3) (1) (2) (3) (1) (1) (1) (1) (2) (1) (3) (1) (2) (1) (3) (1) (1) (1) (2) (1) (3) (1) (1) (2) (1) (3)

More information

23 15961615 1659 1657 14 1701 1711 1715 11 15 22 15 35 18 22 35 23 17 17 106 1.25 21 27 12 17 420,845 23 32 58.7 32 17 11.4 71.3 17.3 32 13.3 66.4 20.3 17 10,657 k 23 20 12 17 23 17 490,708 420,845 23

More information

平成18年度「商品先物取引に関する実態調査」報告書

平成18年度「商品先物取引に関する実態調査」報告書 ... 1.... 5-1.... 6-2.... 9-3.... 10-4.... 12-5.... 13-6.... 15-7.... 16-8.... 17-9.... 20-10.... 22-11.... 24-12.... 27-13... 29-14.... 32-15... 37-16.... 39-17.... 41-18... 43-19... 45.... 49-1... 50-2...

More information

橡統計担当者のためのエクセル表紙.PDF

橡統計担当者のためのエクセル表紙.PDF Num Lock(Pad Lock) ( Num Lock) [ ][ ] [ ][ ] Alt Alt 4 + ( ) 3+3 - ( ) 3-1 -1 * ( ) 3*3 / ( ) 3/3 % ( ) 20% ^ ( ) 3^2 (3*3 ) 2 TRUE FALSE = ( ) A1=B1 > ( ) A1>B1 < ( ) A1= ( ) A1>=B1

More information

(一般演題)口演

(一般演題)口演 O1-001 O1-002! " O1-003! O1-004 " O1-005 " "α O1-006 O2-007 " 233 37 O2-008 O2-009 O2-010! O2-011! O2-012! O3-013 O3-014 O3-015!!! 234 38 O3-016!! O3-017! O3-018 O4-019! O4-020! O4-021 235 39 O5-022 O5-023!

More information

2

2 1 2 119 119 5 500 1 30 102 1 113 3 4 120 2 3 113 5 230 1 1 3 4 5 6 7 8 1 support@kansen.sakura.ne.jp 2 9 3 ( ) 10 11 12 4 1. 2. 3. 4. 13 5 14 15 16 17 18 19 [ ] [ ] 20 [ ] [ ] [ ] 21 22 [ ] 23 < > < >

More information

1 1 2 65

1 1 2 65 3 3 2000 6 14 2 30 4 2 1 1 2 65 1!?? < > 3 2 2 100 19 19 100 100 100 < > 19 2 2 2 2 < > 2000 2000 50 1945 5 50 1945 5 45 20 20 4 1945 4 5 5 5 100 50 20 5 2 20 5 20 5 5 6 20 6 19 5 5 6 5 6 2 20 6 21

More information