untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1 C publicprivate Intelligent Electronic Systems Group protected Carmainmy_car.car_number ca_number //Car class Car int car_number; // void showgas( ); // double gas; // void shownumber( ); // ; //Car void Car::showNumber( ) std::cout << << car_number << n ; void Car::showGas( ) std::cout << << gas << n ; int main( ) my_car.car_number = 4126; my_car.gas = 45.8; my_car.shownumber( ); my_car.showgas( ); // // // // // main main

2 #include<iostream> // class mycls int value; // void setvalue( int n ); // // ; void mycls::setvalue(int n) if( n > 0 ) value = n; else std::cout<<" n"; #include<iostream> // class mycls int value; // ; valuesetvalue() setvalue // value Car( ) ~ ~Car( ) void

3 #include<iostream> //Car class Car ; int car_number; double gas; // // Car( ); // void shownumber( ); // void showgas( ); // void setnumber( int n ); // void setgas( double g ); // int getnumber( ) return car_number; // double getgas( ) return gas; // //Car Car::Car( ) // car_number = 0; gas = 0.0; void Car::showNumber( ) std::cout << << car_number << n ; void Car::showGas( ) std::cout << << gas << n ; if ( gas < 1.0 ) std::cout << n ; void Car::setNumber( int n ) if( n >= 0 && n <=1000 ) car_number = n; else std::cout << n ; void Car::setGas( double g ) if( g >= 0 && g <=100 ) gas = g; else std::cout << n ; int main( ) Car your_car; // //() my_car.setnumber( 4126 ); // my_car.setgas( 45.8 ); // your_car.setnumber( 2981 ); // your_car.setgas( 0.0 ); // my_car.shownumber( ); // my_car.showgas( ); // your_car.shownumber( ); // your_car.showgas( ); // // //shownumbershowgas // std::cout << << my_car.getnumber( ) << n ; // p12-1.cpp

4 pld(currentload) 2 Car Car Truck class ; ; Truck //Car class Car int car_number; // double gas; // Car( ); // void shownumber( ); // void showgas( ); // void setnumber( int n ); // void setgas( double g ); // int getnumber( ) return car_number; // double getgas( ) return gas; // ; //Truck class Truck : public Car double pld; // double CurrentLoad; // double getpld() return pld; double getcurrentload return CurrentLoad; void setpld( double value ); void setcurrentload( double value); ; void Truck::setPLD( double value ) pld = value; void Truck::setCurrentLoad( double value) if(value <= pld) CurrentLoad =value; else std::cout<<" n";

5 Truck Truck Car public private private car_numbergas public protected protected Before After Truckcar_numbergas protected private class : Truckpublic

6 public public public public protected protected private private private= TruckshowNumber() shownumbertruck()

7 //Truck class Truck : public Car void shownumber(); ; // void Truck::showNumber() std::cout << << car_number << n ; std::cout << n ; class, ;

8 (Q)std::cout"std::" (A)stdcout C++ :: using namespace std; cout << "hogehoge! n" using namespace #include <iostream> using namespace std; //std int main() cout << "std:: n"; #include <iostream> namespace MySpace // class Mcls // ; // ; MySpace MySpaceMcls int main() () MySpace::Mcls m_cls; #include <iostream> namespace MySpace // class Mcls // ; // ; using namespace MySpace; int main() Mcls m_cls; MySpace MySpace:: 11-2.cpp Car cars[10]; Car 10

9 //Car class Car int car_number; double gas; void shownumber( ); void showgas( ); void run( double distance); ; // // // // // //Car //Car void Car::showNumber() std::cout << "" << car_number << " n"; //Car void Car::run( double distance ) //10km gas = gas -distance/10.0; if(gas < 0) gas = 0; std::cout << " n"; int main( ) int i; Car cars[3]; //3 for(i=0; i<3; i++) cars[i].car_number = 1000+i; // cars[i].gas = i*10; // for(i=0; i<3; i++) cars[i].shownumber( ); // for(i=0; i<3; i++) cars[i].run( i ); // i (km) cars[i].showgas( ); // p12-2.cpp p12-2.cpp G: paperwork >bcc32 p12-2.cpp Borland C for Win32 Copyright (c) 1993, 2000 Borland p11-1.cpp: Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland G: paperwork >p G: paperwork >

10 Car* p_car; p_car = &my_car; //Car //Car // hoge &hoge[0] hoge *hoge hoge[0] *(hoge+i)hoge[i] p12-2.cpp int main( ) int i; Car cars[2]; Car* my_car; Car* your_car; //2 // // my_car = cars; // your_car = cars+1; // for(i=0; i<2; i++) cars[i].car_number = 1000+i; // (*my_car).shownumber( ); // cars[0].shownumber() (*your_car).shownumber( ); // p12-3.cpp (*my_car).shownumber( ); my_car->shownumber( ); int main( ) int i; Car cars[2]; Car* my_car; Car* your_car; //2 // // my_car = cars; your_car = cars+1; for(i=0; i<2; i++) (cars+i)->car_number = 1000+i; my_car->shownumber( ); your_car->shownumber( ); // // // // // p12-4.cpp

11 //Car void runandshow(car m_car, double dist); // int main(void) my_car.car_number=1000; my_car.gas=50; runandshow(my_car, 10); // // // void runandshow(car m_car, double dist) m_car.run(dist); // m_car.showgas(); // p12-5.cpp //Car void runandshow(, double dist); // int main(void) my_car.car_number=1000; my_car.gas=50; runandshow(, 10); void runandshow(, double dist) // // // // // //Car void runandshow( Car* p_car, double dist); // int main(void) // my_car.car_number=1000; my_car.gas=50; // runandshow( &my_car, 10); // void runandshow( Car* p_car, double dist) p_car->run( dist); // p_car->showgas(); // p12-6.cpp

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

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 << C++ C C++ 1 C++ C++ C C++ C C++? C C++ C *.c *.cpp C cpp VC C++ 2 C++ C++ C++ [1], C++,,1999 [2],,,2001 [3], ( )( ),,2001 [4] B.W. /D.M.,, C,,1989 C Web [5], http://kumei.ne.jp/c_lang/ 3 Hello World Hello

More information

file:///D|/C言語の擬似クラス.txt

file:///D|/C言語の擬似クラス.txt 愛知障害者職業能力開発校 システム設計科 修了研究発表会報告書 題名 : C 言語の擬似クラス あらまし : C 言語でクラスを作れるという噂の真偽を確かめるために思考錯誤した まえがき : VC++ や Java その他オブジェクト指向の言語にはクラスが存在して クラスはオブジェクトの設計図である 手法 : C++ のクラスを解析して C++ のクラスを作成して C 言語に翻訳する class struct

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

(STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector<int> x; for(int i = 0; i < 10;

(STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector<int> x; for(int i = 0; i < 10; (STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector x; for(int i = 0; i < 10; ++i) x.push_back(i); vector STL x.push_back(i) STL

More information

design_pattern.key

design_pattern.key #include void init(int* ary, int size) for (int i = 0; i < size; ++i) ary[i] = i; void mul10(int* ary, int size) for (int i = 0; i < size; ++i) ary[i] *= 10; void dispary(int* ary, int size)

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

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

ソフトゼミC 第二回 C++の基礎

ソフトゼミC 第二回 C++の基礎 2013/08/06 エレクトロニクス研究部 C++ とは何か? ストリームライブラリを使った入出力 cin/coutについて CとC++ の構造体の違い classの基礎とメンバ関数 カプセル化 コンストラクタとは C++ とは何か? C++ はその名の通り C 言語の 拡張として 1983 年に作られた 開発当時は C with Classes と呼ばれ C 言語にクラスの概念を持たせた言語である

More information

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l C/C++ 2007 6 18 1 C STL(1) 2 1.1............................................... 2 1.2 stdio................................................ 3 1.3.......................................... 10 2 11 2.1 sizeof......................................

More information

: : : TSTank 2

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

Java (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) 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 information

cpp1.dvi

cpp1.dvi 2017 c 1 C++ (1) C C++, C++, C 11, 12 13 (1) 14 (2) 11 1 n C++ //, [List 11] 1: #include // C 2: 3: int main(void) { 4: std::cout

More information

JavaプログラミングⅠ

JavaプログラミングⅠ Java プログラミング Ⅰ 12 回目クラス 今日の講義で学ぶ内容 クラスとは クラスの宣言と利用 クラスの応用 クラス クラスとは 異なる複数の型の変数を内部にもつ型です 直観的に表現すると int 型や double 型は 1 1 つの値を管理できます int 型の変数 配列型は 2 5 8 6 3 7 同じ型の複数の変数を管理できます 配列型の変数 ( 配列変数 ) クラスは double

More information

C のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i<=10; i++) sum=sum + i; printf ("sum=%d n",sum); 2

C のコード例 (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 information

cpp4.dvi

cpp4.dvi 2017 c 4 C++ (4) C++, 41, 42, 1, 43,, 44 45, 41 (inheritance),, C++,, 100, 50, PCMCIA,,,,,,,,, 42 1 421 ( ), car 1 [List 41] 1: class car { 2: private: 3: std::string m model; // 4: std::string m maker;

More information

C , C++ C C++ C++ C cpprefjp - C++ 1 C CUI 2.1 donothing.cpp 1

C , C++ C C++ C++ C cpprefjp - C++ 1 C CUI 2.1 donothing.cpp 1 C++ 2018 7 1, 2018 11 4 http://nalab.mind.meiji.ac.jp/~mk/labo/text/nantoka-c++/ 1 C++ C C++ C++ C cpprefjp - C++ 1 C++17 2 2 CUI 2.1 donothing.cpp 1 /* 2 * donothing.cpp 3 */ 4 5 int main() 6 7 return

More information

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

1 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

解きながら学ぶC++入門編

解きながら学ぶC++入門編 !... 38!=... 35 "... 112 " "... 311 " "... 4, 264 #... 371 #define... 126, 371 #endif... 369 #if... 369 #ifndef... 369 #include... 3, 311 #undef... 371 %... 17, 18 %=... 85 &... 222 &... 203 &&... 40 &=...

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

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

oop1

oop1 public class Car{ int num; double gas; // double distance; String maker; // // // void drive(){ System.out.println(""); Car.java void curve(){ System.out.println(""); void stop(){ System.out.println("");

More information

新版明解C言語 実践編

新版明解C言語 実践編 2 List - "max.h" a, b max List - max "max.h" #define max(a, b) ((a) > (b)? (a) : (b)) max List -2 List -2 max #include "max.h" int x, y; printf("x"); printf("y"); scanf("%d", &x); scanf("%d", &y); printf("max(x,

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

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

北米アジャイル界デビュー fkinoからは 何も聞いてませんでした これまでに書いたもの Web 2.0 ビギナーズバイブル エンジニアマインド vol.5 開発の現場 vol.011 Dave 達人 Thomasも云ってたよ http://jp.rubyist.net/rubykaigi2007/?c=plugin;plugin=attach_download;p=program0610;file_name=the_island_of_ruby_j.pdf

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

1 CUI CUI CUI 1.1 cout cin 1.1.1 redirect.cpp #i n c l u d e <s t r i n g > 3 using namespace std ; 5 6 i n t main ( void ) 7 { 8 s t r i n g s ; 10 c

1 CUI CUI CUI 1.1 cout cin 1.1.1 redirect.cpp #i n c l u d e <s t r i n g > 3 using namespace std ; 5 6 i n t main ( void ) 7 { 8 s t r i n g s ; 10 c C/C++ 007 6 11 1 CUI 1.1....................................... 1................................ 3 1.3 argc argv................................. 5.1.............................................. 5...............................................

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

1_cover

1_cover BetweenAS3 Updater Spark Project #APMT 2009.9.11 TAKANAWA Tomoaki ( http://nutsu.com ) http://www.libspark.org/svn/as3/betweenas3/tags/alpha-r3022/ public static function tween(...):iobjecttween { var

More information

1.3 ( ) ( ) C

1.3 ( ) ( ) C 1 1.1 (Data Base) (Container) C++ Java 1.2 1 1.3 ( ) ( ) 1. 2. 3. C++ 2 2.1 2.2 2.3 2 C Fortran C++ Java 3 3.1 (Vector) 1. 2. ( ) 3.2 3 3.3 C++ C++ STL C++ (Template) vector vector< > ; int arrayint vector

More information

新・明解C言語 実践編

新・明解C言語 実践編 第 1 章 見 21 1-1 見えないエラー 見 List 1-1 "max2x1.h" a, b max2 List 1-1 chap01/max2x1.h max2 "max2x1.h" #define max2(a, b) ((a) > (b)? (a) : (b)) max2 List 1-2 List 1-2 chap01/max2x1test.c max2 #include

More information

num9.dvi

num9.dvi kanenko@mbk.nifty.com alexei.kanenko@docomo.ne.jp http://www.kanenko.com/ FORTRAN ( mandelbrot.f) FORTRAN COMPLEX C,Z,W, W=Z**2+C, w = z 2 +c. OK. W=X*Z+2-1/Z Z=CMPLX(X,Y)! x, y z = x+iy X=REAL(Z)! z x

More information

PowerPoint Presentation

PowerPoint 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

exec.dvi

exec.dvi 2018 c 6, Mini-C C++ 6211 611, 61, print,,, (run ),,, (int ), 7, x, x "a" 3 "b" 4 "x" 10 (, ), x STL map 1 + 2, 1 2,, x = ;, 1, 2 x { 1 ; 2 ; ; m, if ( ) { 1 else { 2, 1,, 2 0, 1, 3 0, 2,,, main 6 1 ,,

More information

I java A

I java A I java 065762A 19.6.22 19.6.22 19.6.22 1 1 Level 1 3 1.1 Kouza....................................... 3 1.2 Kouza....................................... 4 1.3..........................................

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

Cプログラミング - 第8回 構造体と再帰

Cプログラミング - 第8回 構造体と再帰 C 8 ( ) C 1 / 30 n! a n+2 = a n+1 + a n ( ) C 2 / 30 #include struct student{ char name[20]; int math; int phys; ; int main(void){ struct student a, b; struct student c={"frank", 90; ( ) C 3 /

More information

1 1.1 *1 1. sep1.cpp main() sep.cpp separate() *1 GNOME KDE 3

1 1.1 *1 1. sep1.cpp main() sep.cpp separate() *1 GNOME KDE 3 C/C++ 007 5 8 1 1.1............................................... 1.......................................... 1.3.......................................... 5 1...........................................

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション :2 :3 8 4 :5 :7 :9 :10 :11 :12 :14 341974 (S 58) 1 210 0 :15 :18 :19 :20 :21 :22 :23 :25 :26 :28 :30 :32 :33 :35 7 1 2 :41 :42 () 1977 3 2 80 2001 6 3 3 :43 :47 :48 :50 :51 () 1 8 BAY :52 :53 2006RUN 2006,2007

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

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

1) OOP 2) ( ) 3.2) printf Number3-2.cpp #include <stdio.h> class Number Number(); // ~Number(); // void setnumber(float n); float getnumber();

1) OOP 2) ( ) 3.2) printf Number3-2.cpp #include <stdio.h> class Number Number(); // ~Number(); // void setnumber(float n); float getnumber(); : : :0757230G :2008/07/18 2008/08/17 1) OOP 2) ( ) 3.2) printf Number3-2.cpp #include class Number Number(); // ~Number(); // void setnumber(float n); float getnumber(); private: float num; ;

More information

2008chom.pdf

2008chom.pdf CHomP Pawe l Pilarczyk 1 CHomP Computational Homology Project [3] OS Windows Mac Unix Linux [3] CHomP [3] 2 3 CHomP CHomP 4 5 C++ [1] 2 CHomP 1 2 K 1 = { A 1 A 2 A 3, A 1 A 2, A 2 A 3, A 1 A 3, A 3 A 4,

More information

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flow

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) flow Java (5) 1 Lesson 3: 2008-05-20 2 x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java 1.1 10 10 0 1.0 2.0, 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flowrate.dat" 10 8 6 4 2 0 0 5 10 15 20 25 time (s) 1 1

More information

新版 明解C++入門編

新版 明解C++入門編 第 1 章画面 出力 入力 C++ C++ C++ C++ C++ C++ C++ C++ #include using C++ C++ C++ main C++ C++ C++ int double char C++ C++ C++ string C++ C++ C++ 21 1-1 C++ 歴史 C++ C++ 歴史 CC with classes Fig.1-1 C C++ Simula 67

More information

プログラミング基礎I(再)

プログラミング基礎I(再) 山元進 クラスとは クラスの宣言 オブジェクトの作成 クラスのメンバー フィールド 変数 配列 メソッド メソッドとは メソッドの引数 戻り値 変数の型を拡張したもの 例えば車のデータベース 車のメーカー 車種 登録番号などのデータ データベースの操作 ( 新規データのボタンなど ) プログラムで使う部品の仕様書 そのクラスのオブジェクトを作ると初めて部品になる 継承 などの仕組みにより カスタマイズが安全

More information

Java 3 p.2 3 Java : boolean Graphics draw3drect fill3drect C int C OK while (1) int boolean switch case C Calendar java.util.calendar A

Java 3 p.2 3 Java : boolean Graphics draw3drect fill3drect C int C OK while (1) int boolean switch case C Calendar java.util.calendar A Java 3 p.1 3 Java Java if for while C 3.1 if Java if C if if ( ) 1 if ( ) 1 else 2 1 1 2 2 1, 2 { Q 3.1.1 1. int n = 2; if (n

More information

Microsoft PowerPoint pptx

Microsoft PowerPoint pptx PFCore(RT ミドルウェア ) トレーニング中級編 10:00-11:00 第 1 部 :RT コンポーネントプログラミングの概要 担当 : 安藤慶昭 ( 産業技術総合研究所 ) 概要 :RT コンポーネントの作成方法, 設計時の注意点などの概要について解説します 第 2 部 :RT ミドルウェア (PFcore) 開発支援ツールと RT コンポーネントの作成方法 11:00-12:00 12:00-13:00

More information

Java演習(4) -- 変数と型 --

Java演習(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 information

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

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç 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 information

問題 01 水道料金を節約しよう 問題のポイント問題文で述べられた仕様を理解し その通りに動作するプログラムを記述できるかを問う問題です 変数 入出力 四則演算に加え 条件分岐や繰り返し処理についての知識が必要です 問題の解き方いくつかのアルゴリズムが考えられますが w が 100 以下と小さい値な

問題 01 水道料金を節約しよう 問題のポイント問題文で述べられた仕様を理解し その通りに動作するプログラムを記述できるかを問う問題です 変数 入出力 四則演算に加え 条件分岐や繰り返し処理についての知識が必要です 問題の解き方いくつかのアルゴリズムが考えられますが w が 100 以下と小さい値な 問題 01 水道料金を節約しよう 問題のポイント問題文で述べられた仕様を理解し その通りに動作するプログラムを記述できるかを問う問題です 変数 入出力 四則演算に加え 条件分岐や繰り返し処理についての知識が必要です 問題の解き方いくつかのアルゴリズムが考えられますが w が 100 以下と小さい値なので 水量を 1m 3 ずつ増やして料金を加算していく簡単なアルゴリズムでも大丈夫です 具体的には 使用水量

More information

untitled

untitled 1 5,000 Copyright 1 5,000...4...4...4...4...4...4...4...5...5...5...5...5...5...6...6...6...7...8...9...9...9...10...12...12...12...12...13...14...14...14...15...15...15 Copyright 1 5,000...16...16...16...16...17...18

More information

untitled

untitled Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright 3269 34 Copyright

More information

tomo_sp1

tomo_sp1 1....2 2....7...14 4....18 5....24 6....30 7....37 8....44...50 http://blog.garenet.com/tomo/ Copyright 2008 1. Copyright 2008 Copyright 2008 Copyright 2008 Copyright 2008 Copyright 2008 Copyright 2008

More information

untitled

untitled Copyright 1 Copyright 2 Copyright 3 Copyright 4 Copyright 5 Copyright 6 Copyright 7 Copyright 8 Copyright 9 Copyright 10 Copyright 11 Copyright 12 Copyright 13 Copyright 14 Copyright 15 Copyright 16 Copyright

More information

2. (297) 91 (365) (366) (371) (673) (938) (64) 85 (91) (631) (561) (302) (616) 63 (906) 68 (338) (714) (747) (169) (718) 62 (1,063) 67 (714) (169) (90

2. (297) 91 (365) (366) (371) (673) (938) (64) 85 (91) (631) (561) (302) (616) 63 (906) 68 (338) (714) (747) (169) (718) 62 (1,063) 67 (714) (169) (90 1. (297) 91 (365) (366) (938) (371) (673) 68 (338) (473) (864) (396) (939) (217) (616) 89 (371) (673) (91) (938) (297) 82 (302) (938) (631) (297) (616) (91) 76 (203) 81 (561) (263) (64) (644) (616) 65

More information

2. (1,009) 45 (368) (226) (133) (54) (260) 25 (446) 30 (774) (156) (805) (244) (652) 22 (128) (652) (157) (597) (805) (446) 30 (774) 35 (238) (581) (1

2. (1,009) 45 (368) (226) (133) (54) (260) 25 (446) 30 (774) (156) (805) (244) (652) 22 (128) (652) (157) (597) (805) (446) 30 (774) 35 (238) (581) (1 1. (189) 42 (133) (362) (93) (1,009) (260) (331) (189) (581) (238) (123) (140) (123) (362) (140) (238) (189) (581) (140) 41 (260) (93) (362) (1,009) (189) 21 (440) 26 (805) (597) (128) (446) (157) (362)

More information

programmingII2019-v01

programmingII2019-v01 II 2019 2Q A 6/11 6/18 6/25 7/2 7/9 7/16 7/23 B 6/12 6/19 6/24 7/3 7/10 7/17 7/24 x = 0 dv(t) dt = g Z t2 t 1 dv(t) dt dt = Z t2 t 1 gdt g v(t 2 ) = v(t 1 ) + g(t 2 t 1 ) v v(t) x g(t 2 t 1 ) t 1 t 2

More information

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) 3 5 14 18 21 23 23 24 28 29 29 31 32 34 35 35 36 38 40 44 44 45 46 49 49 50 pref : 2004/6/5 (11:8) 50 51 52 54 55 56 57 58 59 60 61

More information

Microsoft PowerPoint ppt

Microsoft PowerPoint ppt 独習 Java ( 第 3 版 ) 6.7 変数の修飾子 6.8 コンストラクタの修飾子 6.9 メソッドの修飾子 6.10 Object クラスと Class クラス 6.7 変数の修飾子 (1/3) 変数宣言の直前に指定できる修飾子 全部で 7 種類ある キーワード final private protected public static transient volatile 意味定数として使える変数同じクラスのコードからしかアクセスできない変数サブクラスまたは同じパッケージ内のコードからしかアクセスできない変数他のクラスからアクセスできる変数インスタンス変数ではない変数クラスの永続的な状態の一部ではない変数不意に値が変更されることがある変数

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

ALG2012-A.ppt

ALG2012-A.ppt 21279 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/212/index.html (, )ε m = n C2 = n ( n 1) / 2 m = n ( n 1) 1 11 11 111 11 111 111 1111 1 1 11 1 11 11 111 4-dimentional

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

目 目 用方 用 用 方

目 目 用方 用 用 方 大 生 大 工 目 目 用方 用 用 方 用 方 MS-MPI MPI.NET MPICH MPICH2 LAM/MPI Ver. 2 2 1 2 1 C C++ Fortan.NET C# C C++ Fortan 用 行 用 用 用 行 用 言 言 言 行 生 方 方 一 行 高 行 行 文 用 行 If ( rank == 0 ) { // 0 } else if (rank == 1) {

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++ 入門

C 言語経験者のための C++ 入門 C 言語経験者のための C++ 入門 金森由博 kanamori@cs.tsukuba.ac.jp 2013/4/19 第 1.2 版 2011/7/19 第 1 版 この資料は下記 URL から入手できます http://kanamori.cs.tsukuba.ac.jp/index-ja.html#for_students 1 内容 C++ を学び始めに引っかかりそうなところを概説 この資料の目標は

More information

明解Javaによるアルゴリズムとデータ構造

明解Javaによるアルゴリズムとデータ構造 21 algorithm List 1-1 a, b, c max Scanner Column 1-1 List 1-1 // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); Chap01/Max3.java

More information

P05.ppt

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

More information

解きながら学ぶC++入門編

解きながら学ぶC++入門編 第 1 章 画面 出力 入力 2 問題 1-1 C++ List 1-1p.4 C++ // cout

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

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

(Version: 2017/4/18) Intel CPU 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU do

(Version: 2017/4/18) Intel CPU 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU do (Version: 2017/4/18) Intel CPU (kashi@waseda.jp) 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU double 8087 FPU (floating point number processing unit)

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

text_08.dvi

text_08.dvi C 8 12 6 6 8 Java (3) 1 8.1 8 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 8.2 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

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

(Eclipse\202\305\212w\202\324Java2\215\374.pdf)

(Eclipse\202\305\212w\202\324Java2\215\374.pdf) C H A P T E R 11 11-1 1 Sample9_4 package sample.sample11; public class Sample9_4 { 2 public static void main(string[] args) { int[] points = new int[30]; initializearray(points); double averagepoint =

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

阪神5年PDF.PDF

阪神5年PDF.PDF 1995.1.17 N 0km 10 20 31 4,569 14,679 67,421 55,145 6,965 80 1,471 3,383 13,687 5,538 327 22 933 1,112 12,757 5,675 465 2 243 3,782 6,344 6,641 65 17 555 1,755 9,533 8,109 940 15 12 817 271 3,140 1 918

More information

Microsoft Word - 01_表紙

Microsoft Word - 01_表紙 1 2 3 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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 7.0 190 km 30 62 63 64

More information

渋谷区耐震改修促進計画

渋谷区耐震改修促進計画 1 2 3 2 1,000 ( ) 1,500 ( ) 3 1,000 1 1,000 2,000 3 1,000 2,000 3 1,000 2,000 3 1,000 2,000 3 1,000 2,000 3 1,000 2,000 3 1,000 3 1,000 2,000 3 1,000 2,000 3 1,000 3 1,000 2 1,000 2,000 2 1,000 2,000 2

More information

1,000m 875m1 6km

1,000m 875m1 6km 1,000m 875m1 6km 1,000m 875m 30 13 14 11 2 14 23 27 50 30 3 () 23 24 25 16,534 16,792 18,017 13,946 17,884 18,712 30,480 34,676 36,729 1 (25 ) () 395 1,420 1,343 1,756 1,364 1,599 1,184 1,278 1,619 1,324

More information

一太郎 13/12/11/10/9/8 文書

一太郎 13/12/11/10/9/8 文書 (1) 17 3 (2) (3) (1) 1 (2) 2 (1) (2) (3) (4) (5) (6) (7) (8) 3 (1) 50 12.5km 1km (2) 16 1900 (3) 65 65 19 14 17.5 (4) 34 31 22 335 133 (5) 104 321 3 4 4 43 4 4 4 () 5 6 (1) (2) 7 8 (1) (2)24 24 (3) 9 (4)

More information

私にとっての沖縄と独自性.PDF

私にとっての沖縄と独自性.PDF 6902117 2 1200km 48 11 46 36 40 (1) ( ) 3 1 1-1 1-2 2 (= ) 3 1. 14 14 ( ) ( 2001) ( ) ( ) 1390 1474 ( 2001) ( 4 ) ( ) 46 3000 ( ) = 5 1609 1602 ( 2001) 1-1 1-2 1-1 1-2 15 (2) 6 1314 ( ) (3) ( ) 1 ( 1993:48)

More information