diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..d854387 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,28 @@ +{ + "tasks": [ + { + "type": "cppbuild", + "label": "C/C++: gcc.exe 활성 파일 빌드", + "command": "C:/mingw64/bin/gcc.exe", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "C:/mingw64/bin" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "디버거에서 생성된 작업입니다." + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/basic/1_printf.c b/basic/1_printf.c new file mode 100644 index 0000000..e29f7d4 --- /dev/null +++ b/basic/1_printf.c @@ -0,0 +1,19 @@ +#include + +int main() +{ + int year = 2025; + float price = 9.99; + char grade = 'A'; + char message[] = "Hello, World!"; + unsigned int hexNum = 255; + + printf("Year: %d\n", year); // d: 정수 + printf("Price: %f\n", year); // f: 실수 (소수점 아래 6자리) + printf("Price2: %.2f\n", year); // .2f: 소수점 아래 두 자리 실수 + printf("Grade: %c\n", grade); // c: 문자 + printf("Message: %s\n", message); // x: 16진수 + printf("255 to Hex: %x\n", hexNum); // x: 16진수 + + return 0; +} \ No newline at end of file diff --git a/basic/1_printf.exe b/basic/1_printf.exe new file mode 100644 index 0000000..9d29e4e Binary files /dev/null and b/basic/1_printf.exe differ