diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3df0adca5385c635bd50b310b1b6ecebffeefbd1 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# battle_c + +## Sangkyeong Lee - Team 4 + +실전코딩2 실습 + +## printf + +### stdio.h + +redirection stderr, stdout, stdin에 대해서 배웠음 \ No newline at end of file diff --git a/gitignore b/gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b883f1fdc6d69146f477bba77c117fbbd33714af --- /dev/null +++ b/gitignore @@ -0,0 +1 @@ +*.exe diff --git a/hello.c b/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..b82f2b9208a92ca9acf9c2476ba9a497327757e3 --- /dev/null +++ b/hello.c @@ -0,0 +1,13 @@ +#include <stdio.h> + +int main() { + int a; + fscanf(stdin, "%d", &a); + if (a > 0) + fprintf(stderr, "Error: it is positive\n"); + else + fprintf(stderr, "Error: it is negative\n"); + fprintf(stdout, "Hello World %-10d\n", a); + +} + diff --git a/input_data b/input_data new file mode 100644 index 0000000000000000000000000000000000000000..0180f11137031198cca443db2ad423feb76a1424 --- /dev/null +++ b/input_data @@ -0,0 +1 @@ +Hello World 100 diff --git a/output_data b/output_data new file mode 100644 index 0000000000000000000000000000000000000000..0180f11137031198cca443db2ad423feb76a1424 --- /dev/null +++ b/output_data @@ -0,0 +1 @@ +Hello World 100 diff --git a/stderr.txt b/stderr.txt new file mode 100644 index 0000000000000000000000000000000000000000..da62e877fd7f961933cac390ce56546e26623016 --- /dev/null +++ b/stderr.txt @@ -0,0 +1 @@ +Error: it is positive diff --git a/stdout.txt b/stdout.txt new file mode 100644 index 0000000000000000000000000000000000000000..0180f11137031198cca443db2ad423feb76a1424 --- /dev/null +++ b/stdout.txt @@ -0,0 +1 @@ +Hello World 100 diff --git a/three_files b/three_files new file mode 160000 index 0000000000000000000000000000000000000000..4907bef7de34fa54a0b3bba6cb93e78a6cc32d2d --- /dev/null +++ b/three_files @@ -0,0 +1 @@ +Subproject commit 4907bef7de34fa54a0b3bba6cb93e78a6cc32d2d