Similar documents
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) * *

導入基礎演習.ppt

超初心者用

:30 12:00 I. I VI II. III. IV. a d V. VI

P05.ppt

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf("hello World\n"); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o

C言語によるアルゴリズムとデータ構造

Łñ“’‘‚2004

プリント


kiso2-03.key

1.ppt

C

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

Cプログラミング1(再) 第2回

& & a a * * ptr p int a ; int *a ; int a ; int a int *a

untitled

tuat1.dvi

r07.dvi

ohp07.dvi

[1] #include<stdio.h> main() { printf("hello, world."); return 0; } (G1) int long int float ± ±


untitled

2 Eclipse 2.1 Eclipse 1. Eclipse 2. 3 ( 4) E:Yworkspace OK 3 Eclipse 4 3. Eclipse 5 5 Eclipse Eclipse 2. 7 C 2

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

ex01.dvi

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

DOPRI5.dvi

表1-4.ai

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ }

I117 II I117 PROGRAMMING PRACTICE II SOFTWARE DEVELOPMENT ENV. 1 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara

ex01.dvi

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

(2 Linux Mozilla [ ] [ ] [ ] [ ] URL 2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b

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

,,,,., C Java,,.,,.,., ,,.,, i

pptx

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

橡ボーダーライン.PDF

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

解きながら学ぶC言語

明解Java入門編

comment.dvi

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in

USB ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231

listings-ext

1 4 2 EP) (EP) (EP)

RHEA key

C言語入門

untitled

PowerPoint プレゼンテーション

C言語入門

WinHPC ppt

Taro-ポインタ変数Ⅰ(公開版).j

FX自己アフリエイトマニュアル

FX ) 2

HDZ-2500iS_2570iTS

output2010本文.indd

2) TA Hercules CAA 5 [6], [7] CAA BOSS [8] 2. C II C. ( 1 ) C. ( 2 ). ( 3 ) 100. ( 4 ) () HTML NFS Hercules ( )

Taro-ファイル処理(公開版).jtd

Slide 1

programmingII2019-v01

4 $ alias elixirc="elixirc --ignore-module-conflict" warning redefining module User (current version loaded from Elixir.User.beam) user.ex1 User alias

橡Pro PDF

1st-session key

Transcription:

Ⅰ Report#1

Report#1 printf() /* Program : hello.c Student-ID : 095740C Author UpDate Comment */ #include<stdio.h> int main(){ : Yuhi,TOMARI : 2009/04/28(Thu) : Used Easy Function printf() 10 printf("hello, C World!\n"); 11 return(0); 12} a.out yuuhi-tomari-no-macbook:sample e095740$./a.out Hello, C World! 1 /**/ #include C #include(stdio.h) stdio.h STanDard Input and Output Header= {} main 10printfprintf ( )

11 11return(0); OS= C; h 2,PP.50()

#include<stdio.h> int main(){ printf("hello,\n"); printf("c World\n"); printf("nice to meet you\t"); printf("c World\n"); return(0); }

[] Hello,C World"

[] Hello,C World\ [] Hello,C World!

a. "Hello, C World! n""goodbye,c World! n" 1/* 2 program:hello.c 3 Student-ID:095740C 4 Author:TOMARI,Yuhi 5 UpDate:2009/04/28(Thu) 6 Comment:1stReport 7 */ 8 #include<stdio.h> 9 int main(){ 10 printf("goodbye,cworld\n"); 11 return(0); 12 } a.out yuuhi-tomari-no-macbook:a e095740$./a.out GoodBye,Cworld printf("...")"hello, C World!\n" Hello,C World f(x) f printf"" ""

printf b. [] (i) 2 int main (){ 3 printf("goodbye,cworld\ngoodbye,cworld\ngoodbye,cworld \n"); 4 return(0); 5} (ii) 1#include<stdio.h> 2int main (){ 3 printf("goodbye,cworld\n"); 4 printf("goodbye,cworld\n"); 5 printf("goodbye,cworld\n"); 6 return(0); 7} Report-1.outReport-2.out ( i ) yuuhi-tomari-no-macbook:b e095740$./report-1.out GoodBye,Cworld GoodBye,Cworld GoodBye,Cworld (ii) yuuhi-tomari-no-macbook:b e095740$./report-2.out GoodBye,Cworld GoodBye,Cworld GoodBye,Cworld ( i ) printf(ⅰ)"goodbye,cworld\n" (ii) printf( )"GoodBye,Cworld\n"

b (ii) ( i )printf(); printf(); (ii) ii c. Hello,C World! b-(ii) 1#include<stdio.h> 2int main(){ 3 printf("hello, n"); 4 printf("c World n") 5 return(0); 6} a.out yuuhi-tomari-no-macbook:c e095740$./a.out Hello, C World b-(ii) b-(ii)a

d.printf("...") printf("... n") [] ( i )printf("...") 2 int main(){ 3 printf("hello, C World"); 4 return(0); 5} (ii)printf("... n") 2 int main(){ 3 printf("hello, C World!\n"); 4 return(0); 5} Report.outReport-2.out ( i ) Hello, C Worldyuuhi-tomari-no-macbook:d e095740$_ (ii) Hello, C World! yuuhi-tomari-no-macbook:d e095740$ printf("...") printf("... n") n n

n e.3 ( i ) (ii) [] ( i ) 2 int main(){ 3 printf("hello, C World! Hello, C World! Hello, C World \n"); 4 return(0); 5} (ii) 2 int main(){ 3 printf("hello,c World!"); 4 printf("hello,c World!"); 5 printf("hello,c World!\n"); 6 return(0); 7 } a.out Hello,C World!Hello,C World!Hello,C World! b n b b be c

f. ( * ) * *** ***** *** * [] 2 int main(){ 3 printf(" *\n"); 4 printf(" ***\n"); 5 printf("*****\n"); 6 printf(" ***\n"); 7 printf(" *\n"); 8 return(0); 9 } a.out yuuhi-tomari-no-macbook:f e095740$./a.out * *** ***** *** * 5 e e

g. * [] 2 int main(){ 3 printf("** ** **\n"); 4 printf(" ** ** **\n"); 5 printf(" ******\n"); 6 printf(" ********\n"); 7 printf(" ******\n"); 8 printf(" ** ** **\n"); 9 printf("** ** **\n"); 10 return(0); 11 } a.out yuuhi-tomari-no-macbook:g e095740$./a.out ** ** ** ** ** ** ****** ******** ****** ** ** ** ** ** ** f f h. [1] 2 int main (){ 3 prontf("goodbye,cworld\n"); 4 return(0); 5} -13-

[1] Undefined symbols: "_prontf", referenced from: _main in cchgyk9m.o ld: symbol(s) not found collect2: ld returned 1 exit status [2] 1#include<stdio.h> 2int main (){ 3 printf("goodbye,cworld\n") 4 printf("goodbye,cworld\n") 5 printf("goodbye,cworld\n") 6 return(0) 7 } [2] yuuhi-tomari-no-macbook:~ e095740$ cc Report.c Report.c: In function main : Report.c:4: error: syntax error before printf [] 2 int main (){ 3 printf("goodbye,cworld\ngoodbye,cworld\ngoodbye,cworld \n"); 4 return(0); 5} [] ld warning: in Report, file is not of required architecture Undefined symbols: "_main", referenced from: start in crt1.10.5.o ld: symbol(s) not found collect2: ld returned 1 exit status #include<stdio.h> int main(){ printf("hello,\n"); printf("c World\n"); printf("nice to meet you\n\r"); return(0); } -14-

[] escape.c: In function main : escape.c:4: error: stray \227 in program escape.c:4: error: stray \128 in program escape.c:4: error: stray \128 in program escape.c:4: error: stray \227 in program escape.c:4: error: stray \128 in program escape.c:4: error: stray \128 in program yuuhi-tomari-no-macbook:~ e095740$ "_prontf"printf prontf 24 ; ;.c error error

C http://c-production.com/contents/c/sec09.html -16-