データ構造とアルゴリズム論
|
|
- みさえ かたづ
- 5 years ago
- Views:
Transcription
1 A[1]A[2] 5 5 A1A2 A5 9 A4 A1 A2 A3 A4 A5 9 A[4] [1] [2] [3] [4] [5] 5 A1A2 A5 A(1)A(5) A1 i 1 A2 A3 i5 Yes No A4 A[i] A5 i+1 13
2 Java Java 10 A int A[]; A= new int[10]; int A[] = new int[10]; 20 B double B[] = new double[20]; int A[10] new Java Java [] int[] A = new int[10]; Java A int A[] = new int[10],b; 14
3 int A[] = new int[10]; 0 int A[] = new int[10]; A[0]A[9] 10 0 A[1] int A[] = new int[3]; int B; A[0]=10; A[1]=3; A[2]=8; // B=A[2]; // A[0]A[2] 10,3,8 B 8 int c[]={1,2,3,4,5; c[0]c[4] 1,2,,5 c c[5] 0 15
4 A1A4 A1A4 8 MAX A1 A2 A3 A4 MAX A1 MAX A1 A1>MAXA1 MAX A1 A2 A3 A4 MAX A2 MAX A2 A2>MAX MAX A1 A2 A3 A4 MAX A3 MAX MAX A3<MAX A1 A2 A3 A4 MAX A4 MAX A4 A4>MAX MAX A1 A2 A3 A4 MAX MAX MAX MAX 16
5 A[1]A[4] MAX 0 MAX 0 A1MAX Yes MAX A1 A2MAX Yes No No i1,1,4 Yes MAX A[i] No MAX A2 A3MAX Yes MAX A3 No MAX A4MAX No Yes MAX A4 MAX 100 i1,1,4 i1,1,100 17
6 A[1]A[N]N MIN MAX MIN i2,1,n i2,1,n Yes MAX A[i] No Yes MIN A[i] No MAX MIN A[1]A[N] i 18
7 jtextfieldno jtextfileresult jtextarea1 name Data[0],Data[1],
8 void jbutton1 actionperformed(actionevent e) { // String Text=jTextArea1.getText(); // int No=Integer.parseInt(jTextFieldNo.getText()); // int NLine=jTextArea1.getLineCount(); // int Data[]=new int[nline]; // Data for (int i=0;i<nline;i++) { Data[i]=Integer.parseInt( getline(text,i) ); // jtextfieldresult.settext(string.valueof(data[no-1])); Text No getlinecount() Data Data getline(text,i) Text i getline 0 No Data No-1 20
9 String getline(string Text,int Line) { int Num=Text.length(); //Text int N=0; // String Work; // String Result=""; // // ( n) for (int i=1;i<=num;i++) { Work=Text.substring(i-1,i); //Text i if (Work.equals(" n")) { // if(n==line) { break; // for N=N+1; // Result=""; // else { // Result=Result+Work; return Result; HP p.19 Text 12 n23 n125 n48 n n Text n Result i substring(i-1,i) i N substring(i-1,i+n-1) Text n N Line Result JBuilder n n 21
10 jtextfieldresult jtextarea1 Name 22
11 void jbutton1_actionperformed(actionevent e) { // String Text=jTextArea1.getText(); // int N=jTextArea1.getLineCount(); // A int A[]=new int[n]; // A for (int i=0;i<n;i++) { A[i]=Integer.parseInt(getLine(Text,i)); // int Max; Max=A[0]; // for (int i=1;i<n;i++) { if(a[i]>max) { Max=A[i]; jtextfieldresult.settext(string.valueof(max)); getline(text,i) 2-2 MAX 2-2 A[1] A[0] 23
12 A[1]A[N] m N+1 N+1 A[1] A[2] A[m] A[m+1] A[N] A[1] A[2] A[m] A[m+1] A[m+2] A[N+1] 2-5 m in,-1,m A[i+1] A[i] A[m] ' ' A[N+1]A[N] A[N]A[N-1] A[m+1]A[m] A[m] OK A[m+1]A[m] 24
13 A[1] A[2] A[m] A[m+1] A[m+2] A[N] A[1] A[2] A[m] A[m+1] A[N-1] m i m+1,1,n A[i-1] A[i] A[N] 25
14 A name jtextfieldno jtextarea1 jtextfieldname 26
15 void jbutton1_actionperformed(actionevent e) { int No=Integer.parseInt(jTextFieldNo.getText()); // String Name=jTextFieldName.getText(); // String Text=jTextArea1.getText(); // int N=jTextArea1.getLineCount(); // // Meibo 50 String Meibo[]=new String[50]; // Meibo for (int i=0;i<n;i++) { Meibo[i]=getLine(Text,i); // No for (int i=n-1; i>=no-1 ;i--){ Meibo[i+1]=Meibo[i]; Meibo[ No-1 ]=Name; // Text=""; for (int i=0;i<n+1;i++) { Text=Text+Meibo[i]+" n"; jtextarea1.settext(text); 2-3 getline(text,i) Meibo[0]Meibo[N-1]N 2-5 Meibo[1]Meibo[N] + n p.24 getline() 27
16 N Ans[1]Ans[N] 1 Dosuu1 Dosuu1 0 2 Dosuu2 3 Dosuu3 Dosuu2 0 Dosuu3 0 i1,1,n Ans[i] Dosuu1 Dosuu1+1 Dosuu2 Dosuu2+1 Dosuu3 Dosuu3+1 Dosuu1 Dosuu2 Dosuu3 28
17 Ans[i] Ans[i] Dosuu1Dosuu1+1 Dosuu2Dosuu2+1 Dosuu3Dosuu3+1 Dosuu Ans[i] Dosuu[1]Dosuu[1]+1 Dosuu[2]Dosuu[2]+1 Dosuu[3]Dosuu[3]+1 3 Dosuu[ Ans[i] ] Dosuu[ Ans[i] ]+1 i1,1,3 Dosuu[i] 0 i1,1,n Dosuu[Ans[i]] Dosuu[Ans[i]]+1 i1,1,3 Dosuu[i] 29
18 N Age[1]Age[N] Dosuu[1]Dosuu[7] Dosuu[1] Dosuu[2] Dosuu[3] Dosuu[4] Dosuu[5] Dosuu[6] Dosuu[7] i1,1,7 Dosuu[i] 0 i1,1,n NoAge[i] NoNo[Age[i]/10]+1 No[Age[i]/10] No[Age[i]/10]-1 [x]x Dosuu[1]0 Dosuu[7]0 Dosuu[1]Dosuu[1]+1 Dosuu[7]Dosuu[7]+1 Age[i]60 No Yes Dosuu[No] Dosuu[No]+1 i1,1,7 Dosuu[i] 30
19 B p.29 3 jtextfield3 jtextfield1 jtextfield2 jtextarea1 name 31
20 void jbutton1_actionperformed(actionevent e) { String Text=jTextArea1.getText(); // int N=jTextArea1.getLineCount(); // int Ans[]=new int[n]; // int Dosuu[]=new int[3]; // // Ans for (int i=0;i<n;i++) { Ans[i]=Integer.parseInt(getLine(Text,i)); // for (int i=0;i<3;i++) { Dosuu[i]=0; for (int i=0;i<n;i++) { Dosuu[Ans[i]-1]=Dosuu[Ans[i]-1]+1; // jtextfield1.settext(string.valueof(dosuu[0])); jtextfield2.settext(string.valueof(dosuu[1])); jtextfield3.settext(string.valueof(dosuu[2])); 2-3 getline(text,i) p.29 Dosuu[1]Dosuu[3] 02 Ans Ans[0]Ans[N-1] 0 32
データ構造とアルゴリズム論
15 11 11 Java 21 231-0811 32 152-0033 1 Java 3-5,55,63,39,87,48,70,35,77,59,44 3-5 3-7 score2.txt 75 15 11 11 5-1 3-7 jbuttonread jbuttondisplay jlabelmessage jtextfieldname jtextfieldtokuten
More informationデータ構造とアルゴリズム論
15 11 18 A[0]A[4] 0 1 2 3 5 2 12 9 10 4 12 10 9 5 2 4 3 2 1 0 A 1,2,3,4,5 5,4,3,2,1 87 15 11 18 0 1 2 3 4 A 10 9 12 2 5 10 9 12 2 5 A[0]A[1] 9 10 12 2 5 A[1]A[2] 9 10 12 2 5 A[2]A[3] 9 10 2 12 5 A[3]A[4]
More informationデータ構造とアルゴリズム論
15 12 16 p.8485 Meibo1 A B C 2 E D C B A B C 139 15 12 16 B C Java p.8485 Meibo A,B B A A,B Meibo A,B; A A=new Meibo(); A A B B A B Meibo A new Meibo A B B=new Meibo(); A B Meibo A Meibo B 140 15 12 16
More informationデータ構造とアルゴリズム論
15 12 2 (n-1)(n-2) n Fact(n) factorial Fact Fact(n) X XX*i X1 i:1,1,n Fact(n) AnsFact(n) Ans 123 15 12 2 6-8 void jbuttonkeisan actionperformed(actionevent e) { int Ans,n; n=integer.parseint(jtextfieldn.gettext())
More information: : : TSTank 2
Java (8) 2008-05-20 Lesson6 Lesson5 Java 1 Lesson 6: TSTank1, TSTank2, TSTank3 java 2 car1 car2 Car car1 = new Car(); Car car2 = new Car(); car1.setcolor(red); car2.setcolor(blue); car2.changeengine(jet);
More informationExcel97関数編
Excel97 SUM Microsoft Excel 97... 1... 1... 1... 2... 3... 3... 4... 5... 6... 6... 7 SUM... 8... 11 Microsoft Excel 97 AVERAGE MIN MAX SUM IF 2 RANK TODAY ROUND COUNT INT VLOOKUP 1/15 Excel A B C A B
More information1-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(Basic Theory of Information Processing) 1
(Basic Theory of Information Processing) 1 10 (p.178) Java a[0] = 1; 1 a[4] = 7; i = 2; j = 8; a[i] = j; b[0][0] = 1; 2 b[2][3] = 10; b[i][j] = a[2] * 3; x = a[2]; a[2] = b[i][3] * x; 2 public class Array0
More information漸化式のすべてのパターンを解説しましたー高校数学の達人・河見賢司のサイト
https://www.hmg-gen.com/tuusin.html https://www.hmg-gen.com/tuusin1.html 1 2 OK 3 4 {a n } (1) a 1 = 1, a n+1 a n = 2 (2) a 1 = 3, a n+1 a n = 2n a n a n+1 a n = ( ) a n+1 a n = ( ) a n+1 a n {a n } 1,
More informationA/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 informationdouble 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データ構造とアルゴリズム論
Java jtextfielddata jbuttonwrite jlabelmessage void jbuttonwrite_actionperformed(actionevent e) { String Data=jTextFieldData.getText(); try { // Test1.txt fw FileWriter fw= new FileWriter("Test1.txt");
More informationa n a n ( ) (1) a m a n = a m+n (2) (a m ) n = a mn (3) (ab) n = a n b n (4) a m a n = a m n ( m > n ) m n 4 ( ) 552
3 3.0 a n a n ( ) () a m a n = a m+n () (a m ) n = a mn (3) (ab) n = a n b n (4) a m a n = a m n ( m > n ) m n 4 ( ) 55 3. (n ) a n n a n a n 3 4 = 8 8 3 ( 3) 4 = 8 3 8 ( ) ( ) 3 = 8 8 ( ) 3 n n 4 n n
More information目 次 Java GUI 3 1 概要 クラス構成 ソースコード例 課題...7 i
Java GUI 3 Java GUI 3 - サンプルプログラム (1) - 2011-09-25 Version 1.00 K. Yanai 目 次 Java GUI 3 1 概要...1 2 クラス構成...2 3 ソースコード例...3 4 課題...7 i 1 概要まずは簡単なサンプルプログラムをみながら Java GUI の基本的なことを学びましょう 本サンプルは 図に示すようなひとつのメイン画面を使用します
More informationC による数値計算法入門 ( 第 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 informationhaskell.gby
Haskell 1 2 3 Haskell ( ) 4 Haskell Lisper 5 Haskell = Haskell 6 Haskell Haskell... 7 qsort [8,2,5,1] [1,2,5,8] "Hello, " ++ "world!" "Hello, world!" 1 + 2 div 8 2 (+) 1 2 8 div 2 3 4 map even [1,2,3,4]
More information第1章 ビジュアルプログラミング入門
付録 A 既存のクラスの利用の仕方 第 7 章では フレームクラス (NewJFrame.java) とそこから呼び出されるクラス (Meibo.java など ) を同じプロジェクト内 つまり同じパッケージ内に定義しました しかし 一般には 別のパッケージ ( フォルダ ) に保管されているクラスを利用する場合があります ここでは その方法を説明します なお フォルダは Java の用語ではパッケージに対応するので
More information2
問題 1 次の設問 1~5 に答えよ 設問 1. Java のソースプログラムをコンパイルするコマンドはどれか a) java b) javac c) javadoc d) jdb 設問 2. Java のバイトコード ( コンパイル結果 ) を実行するコマンドはどれか a) java b) javac c) javadoc d) jdb 設問 3. Java のソースプログラムの拡張子はどれか a).c
More information21 1 1 1 2 2 5 7 9 11 13 13 14 18 18 20 28 28 29 31 31 34 35 35 36 37 37 38 39 40 56 66 74 89 99 - ------ ------ -------------- ---------------- 1 10 2-2 8 5 26 ( ) 15 3 4 19 62 2,000 26 26 5 3 30 1 13
More informationuntitled
1 (1) (2) (3) (4) (1) (2) (3) (1) (2) (3) (1) (2) (3) (4) (5) (1) (2) (3) (1) (2) 10 11 12 2 2520159 3 (1) (2) (3) (4) (5) (6) 103 59529 600 12 42 4 42 68 53 53 C 30 30 5 56 6 (3) (1) 7 () () (()) () ()
More informationC言語によるアルゴリズムとデータ構造
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 informationI. (i) Foo public (A). javac Foo.java java Foo.class (C). javac Foo java Foo (ii)? (B). javac Foo.java java Foo (D). javac Foo java Foo.class (A). Jav
2018 06 08 11:00 12:00 I. I III II. III. IV. ( a d) V. VI. 80 40 40 100 60 : A ActionListener aa addactionlistener AE ActionEvent K KeyListener ak addkeylistener KE KeyEvent M MouseListener am addmouselistener
More information5 p Point int Java p Point Point p; p = new Point(); Point instance, p Point int 2 Point Point p = new Point(); p.x = 1; p.y = 2;
5 p.1 5 JPanel (toy example) 5.1 2 extends : Object java.lang.object extends... extends Object Point.java 1 public class Point { // public int x; public int y; Point x y 5.1.1, 5 p.2 5 5.2 Point int Java
More information任意の加算プログラム
HP Java CG Java Graphics CG CG CG paint CG CG paint CG paint Windows paint paint 17 // public Frame1() { enableevents(awtevent.window_event_mask); try { jbinit(); catch(exception e) { e.printstacktrace();
More informationK227 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 information1 2 3 1 34060120 1,00040 2,000 1 5 10 50 2014B 305,000140 285 5 6 9 1,838 50 922 78 5025 50 10 1 2
0120-563-506 / 9001800 9001700 123113 0120-860-777 163-8626 6-13-1 Tel.03-6742-3111 http://www.himawari-life.co.jp 1 2 3 1 34060120 1,00040 2,000 1 5 10 50 2014B 305,000140 285 5 6 9 1,838 50 922 78 5025
More information1 Java Java GUI , 2 2 jlabel1 jlabel2 jlabel3 jtextfield1 jtextfield2 jtextfield3 jbutton1 jtextfield1 jtextfield2 jtextfield3
1 2 2 1 2 2.1.................................................... 2 2.2.................................................... 2 2.3........................................ 2 2.4....................................................
More information1.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 informationPowerPoint Presentation
UML 2004 7 9 10 ... OOP UML 10 Copyright 2004 Akira HIRASAWA all rights reserved. 2 1. 2. 3. 4. UML 5. Copyright 2004 Akira HIRASAWA all rights reserved. 3 1..... Copyright 2004 Akira HIRASAWA all rights
More informationデータ構造とアルゴリズム論
15 10 14 Java jtextfielddata jbuttonwrite jlabelmessage void jbuttonwrite_actionperformed(actionevent e) { String Data=jTextFieldData.getText(); try { // Test1.txt fw FileWriter fw= new FileWriter("Test1.txt");
More information2
問題 次の設問に答えよ 設問. Java のソースコードをコンパイルするコマンドはどれか a) java b) javac c) javadoc d) javaw 設問. Java のバイトコード ( コンパイル結果 ) を実行するコマンドはどれか a) java b) javac c) javadoc d).jar 設問. Java のソースコードの拡張子はどれか a).c b).java c).class
More informationJava (7) Lesson = (1) 1 m 3 /s m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3
Java (7) 2008-05-20 1 Lesson 5 1.1 5 3 = (1) 1 m 3 /s 1 2 3 10 m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3 1.2 java 2 1. 2. 3. 4. 3 2 1.3 i =1, 2, 3 V i (t) 1 t h i (t) i F, k
More informationN N 1,, N 2 N N N N N 1,, N 2 N N N N N 1,, N 2 N N N 8 1 6 3 5 7 4 9 2 1 12 13 8 15 6 3 10 4 9 16 5 14 7 2 11 7 11 23 5 19 3 20 9 12 21 14 22 1 18 10 16 8 15 24 2 25 4 17 6 13 8 1 6 3 5 7 4 9 2 1 12 13
More informationI 4 p.2 4 GUI java.awt.event.* import /* 1 */ import mouseclicked MouseListener implement /* 2 */ init addmouselistener(this) this /* 3 */ this mousec
I 4 p.1 4 GUI GUI GUI 4.1 4.1.1 MouseTest.java /* 1 */ public class MouseTest extends JApplet implements MouseListener /* 2 */ { int x=50, y=20; addmouselistener(this); /* 3 */ public void mouseclicked(mouseevent
More informationP02.ppt
int If 2 1 ,,, 3 a + b ab a - b ab a * b ab a / b ab a % b ab a + b 4 2 list0201.c /, % /*/ int vx, vy; puts(""); printf("vx"); scanf("%d", &vx); printf("vy"); scanf("%d", &vy); printf("vx + vy = %d\n",
More information新・明解Javaで学ぶアルゴリズムとデータ構造
第 3 章 探索 Arrays.binarySearch 743 3-1 探索 探索 searching key 配列 探索 Fig.3-1 b c 75 a 6 4 3 2 1 9 8 2 b 64 23 53 65 75 21 3-1 53 c 5 2 1 4 3 7 4 Fig.3-1 a 763 3-2 線形探索 線形探索 linear search sequential search 2
More informationC¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç
C (3) if else switch AND && OR (NOT)! 1 BMI BMI BMI = 10 4 [kg]) ( [cm]) 2 bmi1.c Input your height[cm]: 173.2 Enter Input your weight[kg]: 60.3 Enter Your BMI is 20.1. 10 4 = 10000.0 1 BMI BMI BMI = 10
More informationQuick Sort 計算機アルゴリズム特論 :2017 年度 只木進一
Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一 2 基本的考え方 リスト ( あるいは配列 )SS の中の ある要素 xx(pivot) を選択 xx より小さい要素からなる部分リスト SS 1 xx より大きい要素からなる部分リスト SS 2 xx は SS 1 または SS 2 に含まれる 長さが 1 になるまで繰り返す pivot xx の選び方として 中央の要素を選択すると効率が良い
More information2003 10 2003.10.21 70.400 YES NO NO YES YES NO YES NO YES NO YES NO NO 20 20 50m 12m 12m 0.1 ha 4.0m 6.0m 0.3 ha 4.0m 6.0m 6.0m 0.3 0.6ha 4.5m 6.0m 6.0m 0.6 1.0ha 5.5m 6.5m 6.0m 50m 18 OK a a a a b a
More informationJava 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言語で学ぶアルゴリズムとデータ構造
第 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 information1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return 0; 戻り値 1: main() 2.2 C main
C 2007 5 29 C 1 11 2 2.1 main() 1 FORTRAN C main() main main() main() 1 return 1 1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return
More informationプログラミングA
プログラミング A 第 10 回 演習 2015 年 6 月 29 日 東邦大学金岡晃 本日の内容 中間テストの解説 演習 1 2015/6/29 プログラミング A 中間テスト解説 : 問 1 < 問 1> 下記の命令が実行された後の a の値を書きなさい ( 省略 ). int a=13; 答え : 13 2 中間テスト解説 : 問 2 < 問 2> 下記の命令が実行された後の a の値を書きなさい
More informationkoji07-02.dvi
007 I II III 1,, 3, 4, 5, 6, 7 5 4 1 ε-n 1 ε-n ε-n ε-n. {a } =1 a ε N N a a N= a a
More informationALG ppt
2012 7 5 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html (198 ) f(p) p 2 1 2 f 2 53 12 41 69 11 2 84 28 31 63 97 58 76 19 91 88 53 69 69 11 84 84 63
More informationC のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i<=10; i++) sum=sum + i; printf ("sum=%d n",sum); 2
アセンブラ (Z80) の例 ORG 100H LD B,10 SUB A LOOP: ADD A,B DEC B JR NZ,LOOP LD (SUM),A HALT ORG 200H SUM: DEFS 1 END 1 C のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i
More informationdouble float
2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................
More information3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");
(Basic Theory of Information Processing) Java (eclipse ) Hello World! eclipse Java 1 3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello
More information新・明解Javaで学ぶアルゴリズムとデータ構造
第 1 章 基本的 1 n 21 1-1 三値 最大値 algorithm List 1-1 a, b, c max // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); List 1-1 System.out.println("");
More informationuntitled
351 351 351 351 13.0 0.0 25.8 1.0 0.0 6.3 92.9 0.0 80.5 0.0 1.5 15.9 0.0 3.5 13.1 0.0 30.0 54.8 18.0 0.0 27.5 1.0 0.0 2.5 94.7 0.0 91.7 0.0 1.3 14.7 0.0 3.8 14.4 0.0 25.0 50.5 16.0 0.0 27.5 2.0 0.0 2.5
More informationmain
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 informationr02.dvi
172 2017.7.16 1 1.1? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X ( ) 1.2 1 2-0 ( ) ( ) ( ) (12) ( ) (112) (131) 281 26 1 (syntax) (semantics) ( ) 2 2.1 BNF BNF(Backus Normal Form) Joun Backus (grammer) English
More informationohp02.dvi
172 2017.7.16 1 ? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X 2 ( ) 3 2-0 ( ) ( ) ( ) (12) ( ) (112) 31) 281 26 1 4 (syntax) (semantics) ( ) 5 BNF BNF(Backus Normal Form) Joun Backus (grammer) English grammer
More informationJava 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 informationTaro-最大値探索法の開発(公開版
最大値探索法の開発 0. 目次 1. 開発過程 1 目標 1 : 4 個のデータの最大値を求める 目標 2 : 4 個のデータの最大値を求める 改良 : 多数のデータに対応するため 配列を使う 目標 3 : n 個のデータの最大値を求める 改良 : コードを簡潔に記述するため for 文を使う 目標 4 : n 個のデータの最大値を求める 改良 : プログラムをわかりやすくするため 関数を使う 目標
More information橡matufw
3 10 25 3 18 42 1 2 6 2001 8 22 3 03 36 3 4 A 2002 2001 1 1 2014 28 26 5 9 1990 2000 2000 12 2000 12 12 12 1999 88 5 2014 60 57 1996 30 25 205 0 4 120 1,5 A 1995 3 1990 30 6 2000 2004 2000 6 7 2001 5 2002
More informationO
11 2 1 2 1 1 2 1 80 2 160 3 4 17 257 1 2 1 2 3 3 1 2 138 1 1 170 O 3 5 1 5 6 139 1 A 5 2.5 A 1 A 1 1 3 20 5 A 81 87 67 A 140 11 12 2 1 1 1 12 22 1 10 1 13 A 2 3 2 6 1 B 2 B B B 1 2 B 100 B 10 B 3 3 B 1
More informationQ&A集
MapViewer & ver.2 EWEB-3C-N055 PreSerV for Web MapViewer & i 1... 1 1.1... 1 1.2... 2 1.3... 3 1.4... 4 1.5... 5 1.6... 6 1.7... 7 1.8... 8 1.9... 9 1.10...11 1.11...12 1.12...13 1.13...14 1.14...15 1.15...16
More information£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡
(2018) 2018 5 17 0 0 if switch if if ( ) if ( 0) if ( ) if ( 0) if ( ) (0) if ( 0) if ( ) (0) ( ) ; if else if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 (0) 2 if else
More information解きながら学ぶJava入門編
44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean
More informationJava プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の break; まで処理しますどれにも一致致しない場合 def
Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の まで処理しますどれにも一致致しない場合 default: から直後の まで処理します 式の結果 ラベル 定数 整数または文字 (byte, short, int,
More informationJava演習(4) -- 変数と型 --
50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends
More informationpptx
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 informationMicrosoft Word - C.....u.K...doc
C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ
More information4 5 6 CHAPTER 1 1 1-1 n % i n = 3 m = 10 k = {1, 3, 5 Yes 1, 1, 3, 5 10 n = 3 m = 9 k = {1, 3, 5 No 9 8 1-1 #include const int MAX_N = 50; int main() { int n, m, k[max_n]; // scanf("%d %d", &n,
More information(個別のテーマ) 薬剤に関連した医療事故
- 67 - III - 68 - - 69 - III - 70 - - 71 - III - 72 - - 73 - III - 74 - - 75 - III - 76 - - 77 - III - 78 - - 79 - III - 80 - - 81 - III - 82 - - 83 - III - 84 - - 85 - - 86 - III - 87 - III - 88 - - 89
More information(個別のテーマ) 放射線検査に関連した医療事故
- 131 - III - 132 - - 133 - III - 134 - - 135 - III - 136 - - 137 - III - 138 - - 139 - III - 140 - - 141 - III - 142 - - 143 - III - 144 - - 145 - III - 146 - - 147 - III - 148 - - 149 - III - 150 - -
More information55 7 Java C Java TCP/IP TCP/IP TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] a
55 7 Java C Java TCP/IP TCP/IP 7.1 7.1.1 TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] argv) { Socket readsocket = new Socket(argv[0], Integer.parseInt(argv[1]));
More informationclass IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =
Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value
More information働く女性の母性健康管理、母性保護に関する法律のあらまし
17 1 3 3 12 3 13 10 19 21 22 22 23 26 28 33 33 35 36 38 39 1 I 23 2435 36 4/2 4/3 4/30 12 13 14 15 16 (1) 1 2 3 (2) 1 (1) (2)(1) 13 3060 32 3060 38 10 17 20 12 22 22 500 20 2430m 12 100 11 300m2n 2n
More information明解Javaによるアルゴリズムとデータ構造
74 searching 3 key Fig.3-1 75 2を探索 53を探索 3-1 5 2 1 4 3 7 4 を探索 Fig.3-1 76 3 linear searchsequential search 2 Fig.3-2 0 ❶ ❷ ❸ 配列の要素を先頭から順に走査していく 探索すべき値と等しい要素を発見 Fig.3-2 6 4 3 2 3-2Fig.3-3 77 5 Fig.3-3 0
More informationALG ppt
2012614 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 1 2 2 3 29 20 32 14 24 30 48 7 19 21 31 4 N O(log N) 29 O(N) 20 32 14 24 30 48 7 19 21 31 5
More information