• 検索結果がありません。

#include <stdio.h&gt

N/A
N/A
Protected

Academic year: 2021

シェア "#include <stdio.h&gt"

Copied!
5
0
0

読み込み中.... (全文を見る)

全文

(1)

C (1) 5E 2003.04.10

1. (nothing.c)

main() {

}

main C 1 ( )

func(x,y,z) func x,y,z

cc -o nothing nothing.c nothing

2. 1 (hello_world.c)

1 Hello World

#include <stdio.h>

main() {

printf("Hello World !!");

}

#include <stdio.h>

(2)

3. 2 (hello_akita.c)

2 1, 2

#include <stdio.h>

main() {

printf("Hello World !!\n");

printf("from Akita National College of Technology !!\n");

}

printf \n

/r /t

/0 null /a Alert

/b Backspace /t horizontal Tab /n New line

/v Vertical Tab /f Form feed /r carriage Return

/" double quotation mark /’ single quotation mark /? question mark

// back slash

(3)

4. (add.c) π+e

#include <stdio.h>

main() {

double a, b, c;

a = 3.1415927;

b = 2.7182818;

c = a+b;

printf("pi = %10.7f\n",a);

printf("e = %13.9f\n",b);

printf("pi+e = %20.12f\n",c);

}

double double

double

float 32 3.4e-38 3.4e+38

double 64 1.7e-308 1.7e+308

long double 80 3.4e-4932 1.1e+4932

%10.7f printf("pi = %10.7f\n",a) a 10.7f

f 10.7 10 7

(4)

5. (outf.c)

sample.txt Hello World

#include <stdio.h>

main() {

FILE *out_file;

out_file = fopen("sample.txt", "w");

fprintf(out_file, "Hello World");

fclose(out_file);

}

FILE out_file

out_file *

FILE *filename;

fopen

"r" (read) NULL

"w" (write)

"a" (append)

"r+" ( ) NULL

"w+" ( )

"a+"

fprintf() printf()

stdout ( )

fclose

(5)

6. (inf.c) sample.txt

#include <stdio.h>

main() {

FILE *in_file;

char ss[256];

in_file = fopen("sample.txt", "r");

fgets(ss, 256, in_file);

printf("%s",ss);

fclose(in_file);

}

char ss[256] 256

fgets

参照

関連したドキュメント

&lt; &gt;内は、30cm角 角穴1ヶ所に必要量 セメント:2.5(5)&lt;9&gt;kg以上 砂 :4.5(9)&lt;16&gt;l以上 砂利 :6 (12)&lt;21&gt; l

this to the reader. Now, we come back to the proof of Step 2. Assume by contradiction that V is not empty.. Let u be the minimal solution with the given boundary values and let P be

At the end of the section, we will be in the position to present the main result of this work: a representation of the inverse of T under certain conditions on the H¨older

Views of Kazunogawa Hydroelectric Power Station Dams &lt;Upper dam (Kamihikawa dam)&gt;. &lt;Lower dam

その職員の賃金改善に必要な費用を含む当該職員を配置するために必要な額(1か所

[r]

When value of &lt;StThr[3:0]&gt; is different from 0 and measured back emf signal is lower than &lt;StThr[3:0]&gt; threshold for 2 succeeding coil current zero−crossings (including