#include #include #include #define UP 72 #define DOWN 80 #define LEFT 75 #define RIGHT 77 #define ENTER 13 #define SPACE 32 // ์ปค์์ขํ์ด๋ void gotoxy(unsigned int x, unsigned int y) { COORD xy = {x, y} ; SetConsoleCursorPosition( GetStdHandle(STD_OUTPUT_HANDLE) , xy ); } // ์์๋ณ๊ฒฝ void set_color(int color , int bgcolor ) { color &= 0xf; bgcolor &= 0xf ; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_..
#include unsigned int get_decimal (char binary[]); int check_binary(char binary[]); int main(void) { char binary[33] = {0,}; //๋ฐฐ์ด์์ด๊ธฐํ. 32๋นํธ์2์ง์์๋ฌธ์์ด๋ฐฐ์ด์ด๋ฏ๋ก๋ง์ง๋ง์๊ณต๋ฐฑ์์ํ1์นธ์ถ๊ฐ unsigned int result; int check; printf("2์ง์→์ง์๋ณํํ๋ก๊ทธ๋จ\n"); printf("32์๋ฆฌ์2์ง์๊น์ง๊ณ์ฐ๊ฐ๋ฅํฉ๋๋ค.\n"); printf("( 0 ์์ ๋ ฅํ๋ฉดํ๋ก๊ทธ๋จ์ด์ข ๋ฃ๋ฉ๋๋ค. )\n\n"); printf("์ซ์๋ฅผ์ ๋ ฅํ์ธ์: "); scanf("%s", binary); while(binary[0] != '0'){ check = check_binary(binary); if (ch..
#include #include #define SIZE 32 //์ต๋32๋นํธ void get_binary (unsigned int n, char arr); void print_binary (char arr); int main(void) { unsigned int n=1; char result[SIZE]; printf("10์ง์→2์ง์๋ณํํ๋ก๊ทธ๋จ\n"); printf("์ ๋ ฅ๊ฐ๋ฅํ์ต๋๊ฐ: %u\n", UINT_MAX); printf("( 0 ์์ ๋ ฅํ๋ฉดํ๋ก๊ทธ๋จ์ด์ข ๋ฃ๋ฉ๋๋ค. )\n\n"); printf("์ซ์๋ฅผ์ ๋ ฅํ์ธ์: "); scanf("%u", &n); while(n != 0){ get_binary(n, result); printf("\n%u๋ฅผ2์ง์๋ก๋ณํํ๋ฉด", n); print_binary(result)..
// while๋ฌธ์์ ์ผํฐ๋(sentinel)์ฌ์ฉ // sentinel : ๋ฐ์ดํฐ์ ๋์ ์๋ฆฌ๋ ๋ฐ ์ฌ์ฉ๋๋ ๊ฐ // ์ ์์ ์ธ ๋ฐ์ดํฐ ๊ฐ์์๋ ์ ๋ ๋ฑ์ฅํ ์ ์๋ ๊ฐ์ผ๋ก ์ ํํ๋ ๊ฒ์ด ์ข๋ค. // ํ๊ท ๊ณ์ฐ #include int main(){ int grade, n; float sum, average; n = 0; sum = 0; grade = 0; printf("์ฑ์ ์ ๋ ฅ์ ์ข ๋ฃํ๋ ค๋ฉด ์์๋ฅผ ์ ๋ ฅํ์ธ์\n\n"); while(grade>=0) { printf("์ฑ์ ์ ๋ ฅ : "); scanf("%d", &grade); sum += grade; n++; } sum = sum - grade;// ์ผํฐ๋๋ก์จ ์ ๋ ฅํ ์์๋ ํฉ๊ณ์ ๋ค์ด๊ฐ์ผ๋ฏ๋ก ๋ค์ ๋นผ์ ์ผํฐ๋ ์ ๊ฑฐ n--; // ์์(์ผํฐ๋)์ ์ ๋ ฅํ๋ ์..
- Stash
- KEYBOARD
- css
- ์ฝ๋ฉ๋ถํธ์บ ํ
- book
- eslint
- review
- js
- ๋ฐ๋๋ผ์ฝ๋ฉ
- string
- GIT
- VSC
- stackoverflow
- ๋ถํธ์บ ํ
- array
- ๋ฐ๋๋ผ์ฝ๋ฉ ํ๊ธฐ
- HTML
- eventlistener
- DOM
- ์์ฑ์ํจ์
- Total
- Today
- Yesterday