untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1 Intelligent Electronic Systems Group 4 PC bitmap.bmp (255,0,0)"" p8-2forint.c or p8-2formot.cdl (printf) (R,G,B)=(127,127,0) (R,G,B)=(255,127,0) viewer bitmap.bmp bit (R,G,B) bitmapbgr (R,G,B)=(255,0,0) 7424:001 prog@apple.ee.uec.ac.jp

2 RGBBGR (photoshop) JPEGMPEG CG OCR

3 1. 2. BGRRGB RGB RGB () unsigned char* LoadBitmap(char* filename, int* width, int* height) int i, size; FILE *fp; unsigned char *buffer; unsigned char tmp_pix; BITMAPFILEHEADER bmfh; BITMAPINFOHEADER bmih; fp = fopen( filename, "rb" ); fread ( &bmfh, sizeof(bitmapfileheader), 1, fp ); fread ( &bmih, sizeof(bitmapinfoheader), 1, fp ); *width = bmih.biwidth; *height = bmih.biheight; size = (*width) *( *height); buffer = (unsigned char*)malloc( 3*size ); for ( i = (*height) - 1; i >= 0; i-- ) fread( buffer + (*width) * 3 * i, 1, (*width) * 3, fp ); fclose( fp ); /**/ /**/ /**/ /**/ /**/ /**/ /**/ for ( i = 0; i < size; i++ ) tmp_pix = buffer[ i * 3 ]; buffer[ i * 3 ] = buffer[ i * ]; buffer[ i * ] = tmp_pix; return buffer; /*BGRRGB()*/ p9-1.c () () void SaveBitmap(char* filename, unsigned char* buffer, int width, int height) int i; FILE *fp; BITMAPFILEHEADER bmfh; BITMAPINFOHEADER bmih; char *tmp; unsigned char tmp_pix; /**/ fp = fopen( filename, "wb" ); /**/ memset(&bmfh,0, sizeof(bmfh)); memset(&bmih,0, sizeof(bmih)); tmp = (char*) &(bmfh.bftype); tmp[0]='b'; tmp[1]='m'; bmfh.bfoffbits = BMP_HEADER_SIZE; bmfh.bfsize = width*height*3 + BMP_HEADER_SIZE; p9-1.c bmih.bisize=bmp_header_size - 14; bmih.biwidth = width; bmih.biheight = height; bmih.biplanes = 1; bmih.bibitcount = 24; bmih.bicompression = 0; bmih.bisizeimage = width*height*3; /*RGBBGR*/ for ( i = 0; i < width * height; i++ ) tmp_pix = buffer[ i * 3 ]; buffer[ i * 3 ] = buffer[ i * ]; buffer[ i * ] = tmp_pix; fwrite( &bmfh, sizeof(bitmapfileheader), 1, fp ); fwrite( &bmih, sizeof(bitmapinfoheader), 1, fp ); /**/ for ( i = height - 1; i >= 0; i-- ) /**/ fwrite( buffer + width * 3 * i, 1, width * 3, fp ); fclose( fp ); /**/ return; p9-1.c

4 main /**/ unsigned char* LoadBitmap(char* filename, int* width, int* height); /**/ void SaveBitmap(char* filename, unsigned char* buffer, int width, int height); RGB int width, height; int n, x, y; BYTE *buffer; BYTE *Rbuffer, *Gbuffer, *Bbuffer; /**/ /**/ int width, height; int n, x, y; unsigned char *buffer; /**/ buffer = LoadBitmap("girl.bmp", &width, &height); /*************************************/ /**/ /****************************************************/ /**/ /**/ SaveBitmap("result.bmp", buffer, width, height); /**/ free( buffer ); return 0; /**/ p9-1.c /**/ buffer = LoadBitmap("girl.bmp", &width, &height); Rbuffer = (BYTE*)malloc( width*height ); Gbuffer = (BYTE*)malloc( width*height ); Bbuffer = (BYTE*)malloc( width*height ); RGB2Plane(buffer, Rbuffer, Gbuffer, Bbuffer, width, height); /*************************************/ /**/ /*************************************************/ /**/ Plane2RGB(buffer, Rbuffer, Gbuffer, Bbuffer, width, height); SaveBitmap("result.bmp", buffer, width, height); /**/ free( buffer ); free( Rbuffer ); free( Gbuffer ); free( Bbuffer ); return 0; /**/ /*RGB*/ /*RGB*/ p9-2.c /*RGBR,G,B*/ void RGB2Plane(BYTE* buffer, BYTE* R, BYTE* G, BYTE* B, int width, int height) int i; /*RGB(R,G,B)*/ for (i=0; i<width*height; i++) /*R,G,BRGB*/ void Plane2RGB(BYTE* buffer, BYTE* R, BYTE* G, BYTE* B, int width, int height) int i; /*RGB(R,G,B)*/ for (i=0; i<width*height; i++) buffer[3*i] = R[i]; buffer[3*i+1] = G[i]; buffer[3*i+2] = B[i]; /*RGBR,G,B*/ void RGB2Plane(BYTE* buffer, BYTE* R, BYTE* G, BYTE* B, int width, int height) int i; /*RGB(R,G,B)*/ for (i=0; i<width*height; i++) R[i] = buffer[3*i]; G[i] = buffer[3*i+1]; B[i] = buffer[3*i+2]; /*R,G,BRGB*/ void Plane2RGB(BYTE* buffer, BYTE* R, BYTE* G, BYTE* B, int width, int height) int i; /*RGB(R,G,B)*/ for (i=0; i<width*height; i++) buffer[3*i] = R[i]; buffer[3*i+1] = G[i]; buffer[3*i+2] = B[i];

5 Q Visual C ExpressLine101 Express Edition A fread.c 101fread.cfread fread fopen fopen NULL NULL fp = fopen( "bitmap.bmp", "rb" ); /**/ if(fp==null) printf(" n"); /**/ fp = fopen( "bitmap.bmp", "rb" ); if(fp==null) printf(" n"); return 0; /**/ (.h) mainmybmp.h main #include mybmp.h #include <stdio.h> #include <stdlib.h> #include <memory.h> #include "mybmpi.h" /**/ /*""*/ p9-3.c mybmpi.hmybmpm.h #include mybmp.h buffer = LoadBitmap( xxx.bmp", &width, &height); Rbuffer = (BYTE*)malloc( width*height );/**/ Gbuffer = (BYTE*)malloc( width*height ); Bbuffer = (BYTE*)malloc( width*height ); RGB2Plane(buffer, Rbuffer, Gbuffer, Bbuffer, width, height); /**/ /*RGB*/ Plane2RGB(buffer, Rbuffer, Gbuffer, Bbuffer, width, height); SaveBitmap("result.bmp", buffer, width, height); buffer[i] RGB Rbuffer Gbuffer Bbuffer

6 2 Rbuffer[0] height x width y xy Rbuffer[y*width+x]; Rbuffer[height*width-1] for(y=0; y<height; y++) for(x=0; x<width; x++) Rbuffer2[y*width+x] = Rbuffer[y*width+x]; width y*width+x y x LoadBmp(); Rbuffer[i] Rbuffer2[i] Rbuffer2[0] Rbuffer[0] R,G,B height height Rbuffer2[(height-1)*width] Rbuffer[1] Rbuffer[2] width xy Rbuffer[y*width+x]; Rbuffer2[width-1-x] width-1-xy Rbuffer2[??]; width Rbuffer[x] Rbuffer[width-1] Rbuffer[2*width-1] Rbuffer[height*width-1] Rbuffer2[width2-3] Rbuffer2[width-2] Rbuffer2[width-1] SaveBitmap(); /**/ /**/ Rbuffer2 = (BYTE*)malloc( width*height ); Gbuffer2 = (BYTE*)malloc( width*height ); Bbuffer2 = (BYTE*)malloc( width*height ); /**/ /*************************************/ for(y=0; y<height; y++) for(x=0; x<width; x++) Rbuffer2[(y+1)*width-1-x] = Rbuffer[y*width+x]; Gbuffer2[(y+1)*width-1-x] = Gbuffer[y*width+x]; Bbuffer2[(y+1)*width-1-x] = Bbuffer[y*width+x]; /*************************************************/ ((y+1)*width-1) x-x /**/ Plane2RGB(buffer, Rbuffer2, Gbuffer2, Bbuffer2, width, height); /*buffer*/ SaveBitmap("result.bmp", buffer, width, height); /**/ p9-4.c

7 x /**/ /**/ Rbuffer2 = (BYTE*)malloc( width*height ); Gbuffer2 = (BYTE*)malloc( width*height ); Bbuffer2 = (BYTE*)malloc( width*height ); /**/ /*************************************/ for(y=0; y<height; y++) for(x=0; x<width; x++) Rbuffer2[(height-y-1)*width+x] = Rbuffer[y*width+x]; Gbuffer2[(height-y-1)*width+x] = Gbuffer[y*width+x]; Bbuffer2[(height-y-1)*width+x] = Bbuffer[y*width+x]; /*************************************************/ Rbuffer2[0] Rbuffer[0] Rbuffer[width-1] /**/ Plane2RGB(buffer, Rbuffer2, Gbuffer2, Bbuffer2, width, height); /*buffer*/ SaveBitmap("result.bmp", buffer, width, height); /**/ p9-5.c Rbuffer2[width2*(height2-1)] y /**/ int width2, height2; /*************************************/ width2=height; height2=width; for(y=0; y<height; y++) for(x=0; x<width; x++) /*************************************************/ /**/ Plane2RGB(buffer, Rbuffer2, Gbuffer2, Bbuffer2, width2, height2);/*buffer*/ SaveBitmap("result.bmp", buffer, width2, height2); /**/ int width2, height2; /*************************************/ width2=height; height2=width; for(y=0; y<height; y++) for(x=0; x<width; x++) Rbuffer2[(height2-x-1)*width2+y] = Rbuffer[y*width+x]; Gbuffer2[(height2-x-1)*width2+y] = Gbuffer[y*width+x]; Bbuffer2[(height2-x-1)*width2+y] = Bbuffer[y*width+x]; /*************************************************/ /**/ Plane2RGB(buffer, Rbuffer2, Gbuffer2, Bbuffer2, width2, height2);/*buffer*/ SaveBitmap("result.bmp", buffer, width2, height2); /**/ /**/ p9-6.c

8 1/21/2 2/3 2/3 int ratio; /**/ ratio=2; /**/ height2=height/ratio; width2=width/ratio; /**/ Rbuffer2 = (BYTE*)malloc( width2*height2 ); Gbuffer2 = (BYTE*)malloc( width2*height2 ); Bbuffer2 = (BYTE*)malloc( width2*height2 ); /**/ /*************************************/ for(y=0; y<height2; y++) for(x=0; x<width2; x++) Rbuffer2[y*width2+x] = Rbuffer[y*width*ratio+x*ratio]; Gbuffer2[y*width2+x] = Gbuffer[y*width*ratio+x*ratio]; Bbuffer2[y*width2+x] = Bbuffer[y*width*ratio+x*ratio]; /*************************************************/ /**/ p9-7.c

9 4 int ratio; /**/ (int) ratio=2; OK height2=height/ratio; width2=width/ratio; /**/ buffer2 = (BYTE*)malloc( width2*height2*3 );/**/ Rbuffer2 = (BYTE*)malloc( width2*height2 ); Gbuffer2 = (BYTE*)malloc( width2*height2 ); Bbuffer2 = (BYTE*)malloc( width2*height2 ); a c q b p 1-q 1-p d =(1-p)(1-q)a+ qb +p(1-q)c+qd a,b,c,d: /*************************************/ for(y=0; y<height2; y++) for(x=0; x<width2; x++) Rbuffer2[y*width2+x] = Rbuffer[((int) (y/ratio))*width + (int) (x/ratio)]; Gbuffer2[y*width2+x] = Gbuffer[((int) (y/ratio))*width + (int) (x/ratio)]; Bbuffer2[y*width2+x] = Bbuffer[((int) (y/ratio))*width + (int) (x/ratio)]; /*************************************************/ /**/ p9-8.c

10 ? HMM-based Super Resolution T.Nagai & T,Nguyen 2003

Microsoft PowerPoint - handout09.ppt

Microsoft PowerPoint - handout09.ppt 応用プログラミング第 9 回 ~ プログラミングの応用画像処理その 2~ 本日の内容 1. まずは課題 2. 画像処理の色々 3. 色々とプログラムを手直ししよう 4. 上下左右の入れ替え 回転 5. 縮小 6. 拡大 7. 拡大するのは難しい 電気通信大学電子工学専攻 Intelligent Electronic Systems Group 長井隆行 課題 bitmap.bmpをコンソールに表示してみましょう!

More information

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

Microsoft PowerPoint - handout09.ppt [互換モード] Outline プログラミング演習第 9 回画像処理の基本その 1 on 2013.01.10 電気通信大学情報理工学部知能機械工学科長井隆行 画像処理入門 ~ 画像を知る~ CCDカメラの仕組み グレースケール画像 カラー画像 画像ファイルのフォーマット 画像の入出力 本日の課題 2 CCD カメラの仕組みを簡単に いよいよ画像 白黒濃淡画像 ( グレースケール画像 ) CCD カメラでは 受光面に映し出された光の情報

More information

Microsoft PowerPoint - handout08.ppt

Microsoft PowerPoint - handout08.ppt 応用プログラミング第 8 回 ~ プログラミングの応用画像処理入門 1~ 本日の内容 1. 画像処理入門 ~ 画像を知る ~ 1. CCD カメラの仕組み 2. グレースケール画像 3. カラー画像 4. 画像ファイルのフォーマット 5. 画像の入出力 2. 課題 3 電気通信大学電子工学専攻 Intelligent Electronic Systems roup 長井隆行 FILE 構造体とは?(

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

02: 変数と標準入出力

02: 変数と標準入出力 C プログラミング入門 基幹 7 ( 水 5) 1 10: ファイル入出力 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/teachers/w48369 2/CPR1/ 2016-06-15 今日の内容 2 標準ライブラリ関数によりファイルの出力を行う画像ファイルの生成を例題として 配列の作成を復習する 文字列の扱いを復習する

More information

02: 変数と標準入出力

02: 変数と標準入出力 C プログラミング入門 基幹 7 ( 水 5) 10: ファイル入出力 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/ teachers/w483692/cpr1/ 2016-06-15 1 標準ライブラリ関数によりファイルの出力を行う 画像ファイルの生成を例題として 配列の作成を復習する 今日の内容 関数を作ってプログラムを構造化する

More information

ディジタル信号処理

ディジタル信号処理 http://www.cfme.chiba-u.jp/~yama// C 言 語 におけるファイル 入 出 力 テキスト バイナリの 取 り 扱 い ( )..[4]% gcc Wall o hoge hoge.c..[5]%./hoge 1 : 1 2 : 2 3 : 3 4 : 0 6..[6]% (! )..[4]% gcc Wall o hoge hoge.c..[5]%!g gcc Wall

More information

講習No.10

講習No.10 2 次元配列 復習 float d[3][4]; 2 次元配列 d[i][j] 2 つのインデックス i と j でデータが指定される 縦が 3 行横が 4 列の float 型の表 4 列 横のインデックスは 3 まで j = 0 j = 1 j = 2 j = 3 3 行 i = 0 i = 1 i = 2 d[0][0] d[0][1] d[0][2] d[0][3] d[1][0] d[1][1]

More information

ex14.dvi

ex14.dvi 1,, 0, b (b b 2 b ) n k n = n j b j, (0 n j b 1), n =(n k n k 1...n 1 n 0 ) b, n j j j +1, 0,...,b 1 (digit). b b, n b 1 ñ, ñ = k (b 1 n j )b j b N, n b n, n = b N n, n =ñ+1 b N, n m n + m (mod b N ),

More information

ディジタル信号処理

ディジタル信号処理 信号処理論 ディジタル画像処理 C 言語におけるファイル入出力 テキスト バイナリの取り扱い ( )..[4]% gcc Wall o hoge hoge.c..[5]%./hoge 1 : 1 2 : 2 3 : 3 4 : 0 6..[6]% (! )..[4]% gcc Wall o hoge hoge.c..[5]%!g gcc Wall o hoge hoge.c..[6]%!! gcc

More information

Microsoft PowerPoint - kougi8.ppt

Microsoft PowerPoint - kougi8.ppt C プログラミング演習 第 8 回構造体とレコードデータファイル 1 例題 1. バイナリファイル形式のファイル からのデータ読み込み 次のような名簿ファイル ( バイナリファイル形式 ) を読み込んで, 画面に表示するプログラムを作る name Ken Bill Mike age 20 32 35 address NewYork HongKong Paris 名簿ファイル 2 #include "stdafx.h"

More information

画像ファイルを扱う これまでに学んだ条件分岐, 繰り返し, 配列, ファイル入出力を使って, 画像を扱うプログラムにチャレンジしてみよう

画像ファイルを扱う これまでに学んだ条件分岐, 繰り返し, 配列, ファイル入出力を使って, 画像を扱うプログラムにチャレンジしてみよう 第 14 回 応用 情報処理演習 ( テキスト : 第 10 章 ) 画像ファイルを扱う これまでに学んだ条件分岐, 繰り返し, 配列, ファイル入出力を使って, 画像を扱うプログラムにチャレンジしてみよう 特定色の画素の検出 ( テキスト 134 ページ ) 画像データが保存されているファイルを読み込んで, 特定色の画素の位置を検出するプログラムを作成しなさい 元画像生成画像 ( 結果の画像 )

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() 2 double *a[ ]; double 1 malloc() double 1 malloc() free() 3 #include #include

More information

(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

(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 Handy Graphic for Handy Graphic Version 0.5 2008-06-09 1 Handy Graphic Handy Graphic C Handy Graphic Handy Graphic Mac OS X Handy Graphic HgDisplayer Handy Graphic HgDisplayer 2 Handy Graphic 1 Handy Graphic

More information

Microsoft PowerPoint - handout10.ppt

Microsoft PowerPoint - handout10.ppt 応用プログラミング第 10 回 ~ プログラミングの応用画像処理その 3~ 電気通信大学電子工学専攻 Intellgent Electronc Systems Group 本日の内容 1. typedefと #defne 2. カラーからグレースケールへ 3. 輝度の変換 4. 画像の2 値化 5. 画像を認識する 画像認識 文字認識 パターン ( テンプレート ) マッチング 6. 数字認識の例

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() malloc 2 #include #include #include enum LENGTH = 10 ; int

More information

Microsoft Word - Cプログラミング演習(10)

Microsoft Word - Cプログラミング演習(10) 第 10 回 (6/25) 3. ファイルとその応用 (3) ファイルの更新 シーケンシャルファイルの更新 シーケンシャルファイルでは, 各レコードが可変長で連続して格納されており, その中の特定のレコードを変更することができない そこで一般的には, マスタファイルからデータを取り出し, 更新処理を行ったあとに新マスタファイルに書き込む 注 ) マスタファイル : 主ファイル, 基本ファイルと呼ばれるファイルで内容は比較的固定的であり,

More information

Microsoft PowerPoint - guidance.ppt

Microsoft PowerPoint - guidance.ppt 例題 1. プログラム実行の体験 Microsoft Visual C++ を使ってみよう コンピュータを役に立つ道具として実 感するために, 次ページのプログラムを使って, Microsoft Visual C++ で のプログラム実行を体験する 例題 1 のプログラムの機能 計算の繰り返し キーボードからのデータ読み込み ファイルへの書き出し #include #include

More information

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose

filea fileb fp = fopen(a, r); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen(b, r); while(fgets(line, BUFSIZ, fp)) {... fclose I117 9 2 School of Information Science, Japan Advanced Institute of Science and Technology file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line,

More information

2004 2005 2 2 1G01P038-0 1 2 1.1.............................. 2 1.2......................... 2 1.3......................... 3 2 4 2.1............................ 4 2.2....................... 4 2.3.......................

More information

情報処理演習 B8クラス

情報処理演習 B8クラス 予定スケジュール ( 全 15 回 ) 1 1. 終了 プログラミング言語の基礎 2. 終了 演算と型 3. 終了 プログラムの流れの分岐 (if 文,switch 文など ) 4. 終了 プログラムの流れの繰返し (do, while, for 文など ) 5. 終了 中間レポート1 6. 終了 配列 7. 終了 関数 8. 終了 文字列 ( 文字列の配列, 文字列の操作 ) 9. 終了 ポインタ

More information

AquesTalk2 Win マニュアル

AquesTalk2 Win マニュアル 株式会社 AQUEST http://www.a-quest.com/ AquesTalk2 Win Manual 1. 概要 本文書は 規則音声合成ライブラリ AquesTalk2 Win をアプリケーションに組み込んで使用するためのプログラミングに関しての方法および注意点を示したものです AquesTalk2 は 簡単に小型機器への組み込みが出来る音声合成ミドルウェアです このライブラリを用いることで

More information

double float

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

プログラミング及び演習 第1回 講義概容・実行制御

プログラミング及び演習 第1回 講義概容・実行制御 プログラミング及び演習 第 6 回ファイル ( 教科書第 9 章 ) (2014/05/23) 講義担当情報連携統轄本部情報戦略室大学院情報科学研究科メディア科学専攻教授森健策 本日の講義 演習の内容 ファイル第 9 章 講義 演習ホームページ http://www.newves.org/~mori/14programming ところで, 現在までに教科書第 1-8 章を終了 段々難しくなっていると思いますか?

More information

計算機プログラミング

計算機プログラミング プログラミング言語 C 第 8 講 システム標準関数 ( 入出力関数 ) システム標準関数 システムに備え付けの関数 例 ) printf( ); scanf( ); 標準出力関数 標準入力関数 A. 入出力用の関数 高水準入出力関数 高水準言語 (OS に依存しない ) 低水準入出力関数 機械語レベル (OS に依存 ) B. それ以外の関数 引数と関数の型 ( 戻り値 ) に注目しましょう 例

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

ohp08.dvi

ohp08.dvi 19 8 ( ) 2019.4.20 1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: 2 (2) NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( 2) 3 (3) head cur tail head cur prev data

More information

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

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

More information

P05.ppt

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

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

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

第7章 有限要素法のプログラミング

第7章 有限要素法のプログラミング April 3, 2019 1 / 34 7.1 ( ) 2 Poisson 2 / 34 7.2 femfp.c [1] main( ) input( ) assem( ) ecm( ) f( ) solve( ) gs { solve( ) output( ) 3 / 34 7.3 fopen() #include FILE *fopen(char *fname, char

More information

untitled

untitled Q 8 1 8.1 (C++) C++ cin cout 5 C++ 16 6 p.63 8.3 #include 7 showbase noshowbase showpoint noshowpoint 8.3 uppercase 16 nouppercase 16 setfill(int) setprecision(int) setw(int) setbase(int) dec

More information

卒 業 研 究 報 告.PDF

卒 業 研 究 報 告.PDF C 13 2 9 1 1-1. 1-2. 2 2-1. 2-2. 2-3. 2-4. 3 3-1. 3-2. 3-3. 3-4. 3-5. 3-5-1. 3-5-2. 3-6. 3-6-1. 3-6-2. 4 5 6 7-1 - 1 1 1-1. 1-2. ++ Lisp Pascal Java Purl HTML Windows - 2-2 2 2-1. 1972 D.M. (Dennis M Ritchie)

More information

AquesTalk プログラミングガイド

AquesTalk プログラミングガイド AquesTalk プログラミングガイド ( 株 ) アクエスト 1. 概要 本文書は 規則音声合成ライブラリ AquesTalk をアプリケーションに組み込んで使用するためのプログラミングに関して 方法および注意点を示したものです AquesTalk には 2 種類のライブラリがあります 音声データをメモリ上に生成するものと サウンドデバイスに出力する 2 種類があります 使用するアプリケーションに応じて選択してください

More information

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

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B A/B (2018/10/19) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2018/soft/soft.html 2018 10 19 A/B 1 2018 10 19 2 1 1 1.1 OHP.................................... 1

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション プログラミング応用演習 第 4 回再帰的構造体 前回の出席確認演習 #include int main() { FILE *fp; int c, linecount, length, maxlength; fp=fopen("/usr/share/dict/words","r"); if (fp == NULL) return 1; linecount=0; length=0;

More information

comment.dvi

comment.dvi ( ) (sample1.c) (sample1.c) 2 2 Nearest Neighbor 1 (2D-class1.dat) 2 (2D-class2.dat) (2D-test.dat) 3 Nearest Neighbor Nearest Neighbor ( 1) 2 1: NN 1 (sample1.c) /* -----------------------------------------------------------------

More information

BW BW

BW BW Induced Sorting BW 11T2042B 2015 3 23 1 1 1.1................................ 1 1.2................................... 1 2 BW 1 2.1..................................... 2 2.2 BW.................................

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

プログラミング及び演習 第1回 講義概容・実行制御

プログラミング及び演習 第1回 講義概容・実行制御 プログラミング及び演習 第 6 回ファイル ( 教科書第 9 章 ) (2017/06/26) 講義担当大学院情報学研究科知能システム学専攻教授森健策 演習担当大学院情報学研究科知能システム学専攻小田昌宏 本日の講義 演習の内容 ファイル第 9 章 講義 演習ホームページ http://www.newves.org/~mori/17programming ところで, 現在までに教科書第 1-8 章を終了

More information

memo

memo 数理情報工学演習第一 C プログラミング演習 ( 第 5 回 ) 2015/05/11 DEPARTMENT OF MATHEMATICAL INFORMATICS 1 今日の内容 : プロトタイプ宣言 ヘッダーファイル, プログラムの分割 課題 : 疎行列 2 プロトタイプ宣言 3 C 言語では, 関数や変数は使用する前 ( ソースの上のほう ) に定義されている必要がある. double sub(int

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

joho07-1.ppt

joho07-1.ppt 0xbffffc5c 0xbffffc60 xxxxxxxx xxxxxxxx 00001010 00000000 00000000 00000000 01100011 00000000 00000000 00000000 xxxxxxxx x y 2 func1 func2 double func1(double y) { y = y + 5.0; return y; } double func2(double*

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

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

t 2 2 t 2 t F ( ) p- 2 2 F 2 G F ( ) 2 2 F 2 G F ( ) 2 2 2

t 2 2 t 2 t F ( ) p- 2 2 F 2 G F ( ) 2 2 F 2 G F ( ) 2 2 2 1 2 2 0 1 2 2 2 2 2 2 2 2.1 2 2 F={f ij }, G {g ij } t f ij t g ij = 1 f ij < t g ij = 0 t p- p S 0 S p = S 0 /S t p 2 t 1 t 2 2 t 2 t 2 2 3 3 1 2 F ( ) p- 2 2 F 2 G 3 2 2 F ( ) 2 2 F 2 G 3 3 2 F ( ) 2

More information

情報画像工学実験I-1

情報画像工学実験I-1 情報画像工学実験 I-1 第二週 : 画像ファイル レポートについて ( 概要 ) 情報画像工学実験レポート 実験項目 : 実験 1 提出先 :1 号棟 501 室前ポスト 期 限 : 次の実験の開始前まで 表 紙 : 学科所定の表紙 実験実施日 : レポート提出日 : 提出者 : http://www.tj.chiba-u.jp/jikken.html サイズ : A4レポート用 ( 印刷の場合は白紙

More information

AquesTalk Win Manual

AquesTalk Win Manual AquesTalk Win マニュアル 株式会社アクエスト http://www.a-quest.com/ 1. 概要 本文書は 規則音声合成ライブラリ AquesTalk をアプリケーションに組み込んで使用するためのプログラミングに関して 方法および注意点を示したものです AquesTalk には 2 種類のライブラリがあります 音声データをメモリ上に生成するものと サウンドデバイスに出力する 2

More information

Taro-リストⅢ(公開版).jtd

Taro-リストⅢ(公開版).jtd リスト Ⅲ 0. 目次 2. 基本的な操作 2. 1 リストから要素の削除 2. 2 リストの複写 2. 3 リストの連結 2. 4 問題 問題 1 問題 2-1 - 2. 基本的な操作 2. 1 リストから要素の削除 まず 一般的な処理を書き つぎに 特別な処理を書く 一般的な処理は 処理 1 : リスト中に 削除するデータを見つけ 削除する場合への対応 特別な処理は 処理 2 : 先頭のデータを削除する場合への対応

More information

lexex.dvi

lexex.dvi (2018, c ) http://istksckwanseiacjp/ ishiura/cpl/ 4 41 1 mini-c lexc,, 2 testlexc, lexc mini-c 1 ( ) mini-c ( ) (int, char, if, else, while, return 6 ) ( ) (+, -, *, /, %, &, =, ==,!=, >, >=,

More information

Microsoft PowerPoint - kougi2.ppt

Microsoft PowerPoint - kougi2.ppt C プログラミング演習 第 2 回 Microsoft Visual Studio.NET を使ってみよう 説明 例題 1. プログラム実行の体験 コンピュータを役に立つ道具として実感する 次ページのプログラムを使って, Microsoft Visual Studio.NETでの C++ ソースファイル編集, ビルド, テスト実行の一連の過程を体験する 例題 1 のプログラムの機能 計算の繰り返し

More information

AquesTalk2 Win マニュアル&ライセンス規定

AquesTalk2 Win マニュアル&ライセンス規定 AQUEST Corp. http://www.a-quest.com/ AquesTalk2 Win 版 Manual & Licence 規定 1. 概要 本文書は 規則音声合成ライブラリ AquesTalk2 Win 版をアプリケーションに組み込んで使用するためのプログラミングに関しての方法および注意点および ライセンスに関して示したものです AquesTalk2 は AquesTalk の後継として開発されました

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

(search: ) [1] ( ) 2 (linear search) (sequential search) 1

(search: ) [1] ( ) 2 (linear search) (sequential search) 1 2005 11 14 1 1.1 2 1.2 (search:) [1] () 2 (linear search) (sequential search) 1 2.1 2.1.1 List 2-1(p.37) 1 1 13 n

More information

AquesTalk2 Linux マニュアル

AquesTalk2 Linux マニュアル AQUEST Corp. http://www.a-quest.com/ 1. 概要 AquesTalk2 Linux Manual 本文書は 規則音声合成ライブラリ AquesTalk2 Linux をアプリケーションに組み込んで使用するためのプログラミングに関しての方法および注意点を示したものです AquesTalk2 は AquesTalk の後継として開発されました 合成音声の声質を規定するデータとして

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

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

新・明解C言語 ポインタ完全攻略 2 1-1 1-1 /* 1-1 */ 1 int n = 100; int *p = &n; printf(" n %d\n", n); /* n int */ printf("*&n %d\n", *&n); /* *&n int */ printf(" p %p\n", p); /* p int * */ printf("&*p %p\n", &*p); /* &*p int * */ printf("sizeof(n)

More information

char char 1 signed char unsigned char ( ; single-quote 0x27) ASCII Japan Advanced Institute of Science and Technology

char char 1 signed char unsigned char ( ; single-quote 0x27) ASCII Japan Advanced Institute of Science and Technology I117 3 1 School of Information Science, Japan Advanced Institute of Science and Technology char char 1 signed char -128 127 unsigned char 0 255 ( ; single-quote 0x27) ASCII Japan Advanced Institute of

More information

untitled

untitled C -1 - -2 - concept lecture keywords FILE, fopen, fclose, fscanf, fprintf, EOF, r w a, typedef gifts.dat Yt JZK-3 Jizake tsumeawase 45 BSP-15 Body soap set 3 BT-2 Bath towel set 25 TEA-2 Koutya

More information

C言語入門

C言語入門 1 C 言語入門 第 7 週 プログラミング言語 Ⅰ( 実習を含む ), 計算機言語 Ⅰ 計算機言語演習 Ⅰ, 情報処理言語 Ⅰ( 実習を含む ) 2 吐き出し法 ( ガウスの消去法 ) のピボッティング 前回の復習 3 連立一次方程式を行列で計算する 吐き出し法 ( ガウスの消去法 ) ステップ 1: 前進消去 ( 上三角行列の作成 ) gaussian_elimination1.c // step1

More information

スライド タイトルなし

スライド タイトルなし ファイル入出力 (2) これまでのおさらい ( 入出力 ) これまでの入出力は 入力 scanf 出力 printf キーボードと画面 ( 端末 ) scanf/printf は 書式つき入出力 フォーマットを指定する 標準入出力を対象とする 何もしなければ 標準入出力は キーボードと画面 ストリームという考え方 ストリーム (stream) = データの列 キーボードから打つ文字列 画面に出力される文字列

More information

プログラミング基礎

プログラミング基礎 C プログラミング 演習 アルゴリズム基礎論 演習 第 10 回 今後の予定 12/22( 月 ) 期末試験 (60 分間 ) 場所 :A1611 時間 :16:20~17:20 課題の最終提出締切 :12/19( 金 ) これ以降の新規提出は評価されない 12/22までに最終状況を提示するので, 提出したのに や になってる人は自分の提出内容や提出先を再確認した上で12/26までに問い合わせること

More information

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h>

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h> 2007 12 5 1 2 2.1 ( ) 1 1: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #define H WIN 400 // 8 #define W WIN 300 // 9

More information

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

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 I 4 003 4 30 1 ASCII ( ) 0 17 0 NUL 16 DLE SP 0 @ P 3 48 64 80 96 11 p 1 SOH 17 DC1! 1 A Q a 33 49 65 81 97 113 q STX 18 DC " B R b 34 50 66 8 98 114 r 3 ETX 19 DC3 # 3 C S c 35 51 67 83 99 115 s 4 EOT

More information

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

Microsoft PowerPoint - 14th.ppt [互換モード] 工学部 6 7 8 9 10 組 ( 奇数学籍番号 ) 担当 : 長谷川英之 情報処理演習 第 14 回 2011 年 1 月 20 日 1 今日のテーマ ファイル入出力 ですが, キーボード入力などもおさらいします 2 標準入力 キーボードで入力 : 標準入力という例 )scanf( %d,&i) 前回までの講義でファイルからデータを読み込む場合に使用した関数 : fscanf 例 )fscanf(fin,

More information

02: 変数と標準入出力

02: 変数と標準入出力 C プログラミング入門 基幹 2 ( 月 4) 11: 動的メモリ確保 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/ teachers/w483692/cpr1/ 2014-06-22 1 まとめ : ポインタを使った処理 内容 説明 呼び出し元の変数を書き換える第 9 回 文字列を渡す 配列を渡す 第 10 回 ファイルポインタ

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

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション プログラミング応用演習 第 4 回再帰的構造体 プログラミングを 余談 : 教えることの難しさ 丁寧に説明しないと分かってもらえない 説明すると 小難しくなる学生が目指すべきところプログラム例を説明されて理解できる違うやり方でも良いので自力で解決できる おっけー 動けば良い という意識でプログラミング 正しく動くことのチェックは必要 解答例と自分のやり方との比較が勉強になる 今日のお題 再帰的構造体

More information

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

Microsoft PowerPoint - CproNt11.ppt [互換モード] 第 11 章入出力関数とライブラリ関数 CPro:11-01 概要 getchar putchar gets puts scanf printf strcat strcmp strcpy strlen atoi atof sprint sscanf 11.1 コンソール入出力関数 11-02 入力 出力 getchar putchar 一文字 gets puts 文字列 ( 一行 ) scanf printf

More information

02: 変数と標準入出力

02: 変数と標準入出力 C プログラミング入門 総機 1 ( 月 1) 11: 動的メモリ確保 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/ teachers/w483692/cpr1/ 2015-06-22 1 まとめ : ポインタを使った処理 内容 説明 呼び出し元の変数を書き換える第 9 回 文字列を渡す 配列を渡す 第 10 回 ファイルポインタ

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

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

‚æ2›ñ C„¾„ê‡Ìš| I 8 10 10 I ( 6 ) 10 10 1 / 23 1 C ( ) getchar(), gets(), scanf() ( ) putchar(), puts(), printf() 1 getchar(), putchar() 1 I ( 6 ) 10 10 2 / 23 1 (getchar 1 1) 1 #include 2 void main(void){ 3 int

More information

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

全体ロードマップ インターネット電話 音の符号化 ( 信号処理 ) 今日 音の録音 再生 ネットワーク ( ソケット ) プログラミング ファイル入出力 インターネットの基礎 C プログラミング基礎

全体ロードマップ インターネット電話 音の符号化 ( 信号処理 ) 今日 音の録音 再生 ネットワーク ( ソケット ) プログラミング ファイル入出力 インターネットの基礎 C プログラミング基礎 ファイル入出力 全体ロードマップ インターネット電話 音の符号化 ( 信号処理 ) 今日 音の録音 再生 ネットワーク ( ソケット ) プログラミング ファイル入出力 インターネットの基礎 C プログラミング基礎 今日のロードマップ 波形として可視化 (gnuplot) 課題 2.13, 2.15 音を自分のプログラムに読み込む (rec + read) 音を作って鳴らす (write + play)

More information

main main Makefile Makefile C.5 Makefile Makefile Makefile A Mech (TA ) 1. Web (http://www.jsk.t.u-tokyo.ac.jp/ iku

main main Makefile Makefile C.5 Makefile Makefile Makefile A Mech (TA ) 1. Web (http://www.jsk.t.u-tokyo.ac.jp/ iku 2008 (mizuuchi@i.u-tokyo.ac.jp) http://www.jsk.t.u-tokyo.ac.jp/ http://www.jsk.t.u-tokyo.ac.jp/ ikuo/enshu/keisanki/ 2008 5 19 6 24 1 2 2.1 my_sound.c, my_sounc.h, play.c, record.c 2 2. 2.2 2.2.1 main

More information

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D 6 2019 5 14 6.1 Minimum C....................... 6 1 6.2....................................... 6 7 6.1 Minimum C Minimum C BNF T okenseq W hite Any Digit ::= 0 1 2... 9. Number ::= Digit Digit. Alphabet

More information

slide4.pptx

slide4.pptx ソフトウェア工学入門 第 4 回ライブラリ関数 ライブラリ関数 stdio stdio : 標準入出力ライブラリ カーネルレベルのストリームに API を追加し インタフェースを提供する カーネル fd read(2) write(2) stdio バッファ BUFSIZ プログラム BUFSIZ ごと 小さい単位 バッファ : 一時的にデータを保存しておく場所のことバッファリング : バッファを経由してデータをやり取りすること

More information

: Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p.

: Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p. stdio considered harmful akr@m17n.org 2005 06 02 stdio considered harmful p. : Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p. : stdio stdio Nonblocking

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

2009 T060050

2009 T060050 T060050 C++ Microsoft Visual C++ 2008 Express Edition DX C DX VC++ Debug exe 1 2 2009 T060050 1 1 2 1 2.1...................... 1 2.2....................... 2 3 3 3.1................... 3 3.2.....................

More information

program.dvi

program.dvi 2001.06.19 1 programming semi ver.1.0 2001.06.19 1 GA SA 2 A 2.1 valuename = value value name = valuename # ; Fig. 1 #-----GA parameter popsize = 200 mutation rate = 0.01 crossover rate = 1.0 generation

More information

pptx

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

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

Microsoft Word - C.....u.K...doc C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ

More information

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

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 >= II 14 2018 7 26 : : proen@mm.ics.saitama-u.ac.jp 14,, 8 2 12:00 1 O(1) n O(n) O(log n) O(1) 32 : 1G int 4 250 M 2.5 int 21 2 0 100 0 100 #include #define HASHSIZE 100 /* */ #define NOTFOUND 0

More information

02: 変数と標準入出力

02: 変数と標準入出力 C プログラミング入門 基幹 7 ( 水 5) 11: 動的メモリ確保 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/ teachers/w483692/cpr1/ 2016-06-22 1 まとめ : ポインタを使った処理 内容呼び出し元の変数を書き換える文字列を渡す 配列を渡すファイルポインタ複数の値を返す大きな領域を確保する

More information

CudaWaveField

CudaWaveField CudaWaveField 2012 3 22 2 CudaWaveField Rel 1.0.0 Rel 1.0 CudaWaveField ( cwfl) / cwfl cwfl http://www.laser.ee.kansai-u.ac.jp/wavefieldtools Note Acrobat Reader 3 I CudaWaveField 9 1 11 1.1 CudaWaveField......................

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

1. ファイルにアクセスするには ファイルにアクセスするには 1. ファイルを開く 2. アクセスする 3. ファイルを閉じるという手順を踏まなければなりません 1.1. ファイルを読み込む まずはファイルの内容を画面に表示させるプログラムを作りましょう 開始 FILE *fp char fname

1. ファイルにアクセスするには ファイルにアクセスするには 1. ファイルを開く 2. アクセスする 3. ファイルを閉じるという手順を踏まなければなりません 1.1. ファイルを読み込む まずはファイルの内容を画面に表示させるプログラムを作りましょう 開始 FILE *fp char fname ファイル入出力 三池克明 ファイルのデータを読込む あるいは書込む方法と CSV 形式のファイル処理 について解説します 目次 1. ファイルにアクセスするには... 1 1.1. ファイルを読み込む...1 1.2. ソースコードを簡潔にする...9 1.3. ファイルに書き込む...11 2. CSV ファイルにアクセスする... 14 2.1. CSV ファイルを作成する...14 2.2.

More information

Microsoft Word - Cプログラミング演習(9)

Microsoft Word - Cプログラミング演習(9) 第 9 回 (6/18) 3. ファイルとその応用 外部記憶装置に記録されたプログラムやデータを, ファイルと呼ぶ シーケンシャルファイルやランダムファイルへのデータの記録や読み出し, 更新の手順について学習する (1) ファイルとレコードファイル複数の関連したデータを一つに集めたり プログラムを外部記憶装置に保存したものレコードファイルを構成する一塊のデータ ex. 個人カードフィールドレコードを構成する個別の要素

More information

Microsoft PowerPoint - kougi9.ppt

Microsoft PowerPoint - kougi9.ppt C プログラミング演習 第 9 回ポインタとリンクドリストデータ構造 1 今まで説明してきた変数 #include "stdafx.h" #include int _tmain(int argc, _TCHAR* argv[]) { double x; double y; char buf[256]; int i; double start_x; double step_x; FILE*

More information

O(N) ( ) log 2 N

O(N) ( ) log 2 N 2005 11 21 1 1.1 2 O(N) () log 2 N 1.2 2 1 List 3-1 List 3-3 List 3-4? 3 3.1 3.1.1 List 2-1(p.70) 1 1 10 1 3.1.2 List 3-1(p.70-71) 1 1 2 1 2 2 1: 1 3 3.1.3 1 List 3-1(p.70-71) 2 #include stdlib.h

More information

untitled

untitled 20 7 1 22 7 1 1 2 3 7 8 9 10 11 13 14 15 17 18 19 21 22 - 1 - - 2 - - 3 - - 4 - 50 200 50 200-5 - 50 200 50 200 50 200 - 6 - - 7 - () - 8 - (XY) - 9 - 112-10 - - 11 - - 12 - - 13 - - 14 - - 15 - - 16 -

More information

untitled

untitled 19 1 19 19 3 8 1 19 1 61 2 479 1965 64 1237 148 1272 58 183 X 1 X 2 12 2 15 A B 5 18 B 29 X 1 12 10 31 A 1 58 Y B 14 1 25 3 31 1 5 5 15 Y B 1 232 Y B 1 4235 14 11 8 5350 2409 X 1 15 10 10 B Y Y 2 X 1 X

More information

格子点データの解析 4 気象庁合成レーダーの解析 気象庁合成レーダーは全国 20 か所に設置された気象レーダーによって観測されたエコー強度 ( レーダーで観測される換算降水強度 ) とエコー頂高度 ( レーダーで観測される降水エコーの高さ ) のデータです エコー強度は格子間隔が 1 km エコー頂

格子点データの解析 4 気象庁合成レーダーの解析 気象庁合成レーダーは全国 20 か所に設置された気象レーダーによって観測されたエコー強度 ( レーダーで観測される換算降水強度 ) とエコー頂高度 ( レーダーで観測される降水エコーの高さ ) のデータです エコー強度は格子間隔が 1 km エコー頂 格子点データの解析 4 気象庁合成レーダーの解析 気象庁合成レーダーは全国 20 か所に設置された気象レーダーによって観測されたエコー強度 ( レーダーで観測される換算降水強度 ) とエコー頂高度 ( レーダーで観測される降水エコーの高さ ) のデータです エコー強度は格子間隔が 1 km エコー頂高度は 2.5 km であり どちらも 10 分おきにデータが得られます ここでは GRIB2 形式で保存されているエコー強度データを用いて

More information

02: 変数と標準入出力

02: 変数と標準入出力 C プログラミング入門 基幹 7 ( 水 5) 1 11: 動的メモリ確保 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/teachers/w48369 2/CPR1/ 2017-06-28 まとめ : ポインタを使った処理 2 内容呼び出し元の変数を書き換える文字列を渡す 配列を渡すファイルポインタ複数の値を返す大きな領域を確保する

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