センター試験 山中和義 2008/01/21 10:52:40 ├問題文のアルゴリズムを素直に書くと 白石 和夫 2008/01/21 11:20:55 │└余りを求めるのに 白石 和夫 2008/01/21 11:30:29 │ ├あえて試験だから、このようにコード化する... 山中和義 2008/01/21 11:54:42
Re: 余りを求めるのに |
返事を書く ノートメニュー |
山中和義 <drdlxujciw> 2008/01/21 11:54:42 | |
あえて試験だから、このようにコード化するのでしょうか。
170〜260、220〜230の繰り返しなどのように、「判断(IF)」を「繰り返し」に使った流れ図は、 構造化の命令にコード化しづらいです。 センター試験の出題範囲にDO WHILE/DO UNTILなどはないのですかね。 ●出題の元になる流れ図(たぶん?) 過去掲示板のプログラム 流れ図を描く http://freebbs.around.ne.jp/article/b/basic/103/dkoxkw/dkoxkw.html#dkoxkw を使って(プログラムの終りにあるDATA文の差し替える)流れ図を描くことができます。 10 DATA 1,"3","開始","第6問" DATA 8,"3","X","x=" DATA 8,"3","Y","y=" DATA 5,"0<","3≧","X:Y","" DATA 13,"3","│","" DATA 3,"3","X*Y→T","" DATA 2,"","1","" DATA 0,"","","" DATA 0,"","","" DATA 0,"","","" DATA 3,"3","X→Z","" DATA 3,"3","Y→X","" DATA 3,"2","Z→Y","" DATA 0,"","","" DATA 2,"3","1","170" DATA 5,"3=","0≠","Y:0","" DATA 9,"3","X","GCD" DATA 9,"3","T/X","LCM" DATA 1,"","終了","" DATA 0,"","","" DATA 0,"","","" DATA 0,"","","" DATA 13,"0","─","" DATA 13,"0","┌","" DATA 13,"1","└","" DATA 0,"","","" DATA 0,"","","" DATA 0,"","","" DATA 0,"","","" DATA 3,"3","X→R","210" DATA 3,"3","R-Y→R","220" DATA 5,"2>=","3<","R:Y","230" DATA 3,"3","Y→X","" DATA 3,"3","R→Y","" DATA 2,"","1","" |
│ │└みごとなスパゲッティ・プログラムです。 白石 和夫 2008/01/21 17:59:57 (修正1回) │ │ └過去問題をいくつか見てみると、パターンが... 山中和義 2008/01/22 20:52:21 │ └ユークリッドのアルゴリズムは除算を用いな... 白石 和夫 2008/01/21 11:54:53 (修正1回) ├全文を、書かせる出題方法は、とれないもの... SECOND 2008/01/21 15:17:01 │└!整理すると、こんなに短いものです。 SECOND 2008/01/21 21:09:19 (修正4回) └素朴な疑問 小塚貞典 2008/01/21 22:02:59 └問題点と背景について私見 小塚貞典 2008/01/23 10:20:03