Coding_Algorithm/์ •์˜ฌ ๋ฌธ์ œํ’€์ด

[์ •์˜ฌ] ๊ธฐ์ดˆ๋‹ค์ง€๊ธฐ_์„ ํƒ์ œ์–ด๋ฌธ_ํ˜•์„ฑํ‰๊ฐ€3_ code122

[์ •์˜ฌ] ๊ธฐ์ดˆ๋‹ค์ง€๊ธฐ_์„ ํƒ์ œ์–ด๋ฌธ_ํ˜•์„ฑํ‰๊ฐ€3_ code122 ๋…„๋„๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ ์œค๋…„(leap year)์ธ์ง€ ํ‰๋…„(common year)์ธ์ง€ ํŒ๋‹จํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. 2008leap year 400์œผ๋กœ ๋‚˜๋ˆ„์–ด๋–จ์–ด์ง€๋ฉด ์œค๋…„์ด๋‹ค. ๋˜๋Š” 4๋กœ ๋‚˜๋ˆ„์–ด๋–จ์–ด์ง€๊ณ  100์œผ๋กœ ๋‚˜๋ˆ„์–ด๋–จ์–ด์ง€์ง€ ์•Š์œผ๋ฉด ์œค๋…„์ด๋‹ค. ๋‚˜๋จธ์ง€๋Š” ๋ชจ๋‘ ํ‰๋…„์ด๋‹ค. [์ •๋‹ต ์ฝ”๋“œ-C์–ธ์–ด] #include int main(){int year;scanf("%d", &year);if (year%400 == 0)printf("leap year");else if (year%4 == 0 && year%100 != 0)printf("leap year");elseprintf("common year");return 0;} ๋ณด๊ธฐ์—๋Š” ์–ด๋ ค์›Œ๋ณด์ด๋Š” ๋ฌธ์ œ์ผ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ํžŒํŠธ๋งŒ..

2019.03.17 ๊ฒŒ์‹œ๋จ

Coding_Algorithm/์ •์˜ฌ ๋ฌธ์ œํ’€์ด

[์ •์˜ฌ] ๊ธฐ์ดˆ๋‹ค์ง€๊ธฐ_์„ ํƒ์ œ์–ด๋ฌธ_ํ˜•์„ฑํ‰๊ฐ€2_ code121

[์ •์˜ฌ] ๊ธฐ์ดˆ๋‹ค์ง€๊ธฐ_์„ ํƒ์ œ์–ด๋ฌธ_ํ˜•์„ฑํ‰๊ฐ€2_ code121 ์ •์ˆ˜๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ 0 ์ด๋ฉด "zero" ์–‘์ˆ˜์ด๋ฉด "plus" ์Œ์ˆ˜์ด๋ฉด "minus" ๋ผ๊ณ  ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. 0 zero [์ •๋‹ต ์ฝ”๋“œ-C์–ธ์–ด] #include int main(){int a;scanf("%d", &a);if (a 0)printf("plus");elseprintf("zero");return 0;} C++, Java, Python๋“ฑ์˜ ๋‹ค๋ฅธ ์–ธ์–ด๋“ค์€ ๊ณ„์† ์—…๋ฐ์ดํŠธ ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ถ๊ธˆํ•˜์‹ ์ ์€ ์–ธ์ œ๋‚˜ ์งˆ๋ฌธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

2019.03.17 ๊ฒŒ์‹œ๋จ

 ํฌ์ŠคํŒ… ์ธ๋„ค์ผ ์ด๋ฏธ์ง€

Coding_Algorithm

[์ฝ”๋”ฉ ๊ฟ€ํŒ] ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์ฝ”๋“œ ์˜ˆ์˜๊ฒŒ ๋ณต๋ถ™ํ•˜๊ธฐ

์˜ค๋Š˜์€ ์ฝ”๋“œ๋ฅผ ์ œ์ถœํ•˜๊ฑฐ๋‚˜ ๊ณต์œ ํ•  ์ผ์ด ์žˆ์„๋•Œ, ์‚ฌ์šฉํ•˜๋ฉด ์ข‹์€ ์‚ฌ์ดํŠธ๋ฅผ ์•Œ๋ ค๋“œ๋ฆฌ๋ ค๊ณ  ํ•ด์š”! ๋ฐ”๋กœ ColorScripter๋ผ๋Š” ์‚ฌ์ดํŠธ์ธ๋ฐ์š”! https://colorscripter.com/ - ๋งํฌ์ž…๋‹ˆ๋‹ค:) ๋ณดํ†ต ํ”„๋กœ๊ทธ๋ž˜๋ฐ ํ”„๋กœ๊ทธ๋žจ์„ ์ด์šฉํ•˜๋ฉด ๋‹ค๋ฅธ์‚ฌ๋žŒ๋“ค์—๊ฒŒ ๊ณต์œ ํ•˜๊ฑฐ๋‚˜ ๊ธ€์„ ์“ธ ๋•Œ ๋ณต๋ถ™ํ•˜๊ฑฐ๋‚˜ ๋‹ค์‹œ ์“ธ ๋•Œ๊ฐ€ ๋งŽ์€๋ฐ์š”, ์ด๋ฅผ ๊น”๋”ํ•˜๊ฒŒ ์ •๋ฆฌํ•ด์ฃผ๋Š” ์‚ฌ์ดํŠธ๊ฐ€ ๋ฐ”๋กœ colorscripter์ž…๋‹ˆ๋‹ค:) ์ด ์‚ฌ์ดํŠธ๋ฅผ ์ด์šฉํ•˜๋ฉด ์ œ ์ •์˜ฌ ๋ฌธ์ œํ’€์ด ๊ฒŒ์‹œ๋ฌผ์ฒ˜๋Ÿผ ์ƒ‰๊น”๋„ ๋‹ค๋ฅด๊ฒŒ ๋‚˜์˜จ๋‹ต๋‹ˆ๋‹ค:) ์ œ ์ •์˜ฌ๋ฌธ์ œํ’€์ด ๊ฒŒ์‹œ๊ธ€์— ๊ด€์‹ฌ์žˆ์œผ์‹  ๋ถ„๋“ค์€ ๋…ํ•™๋‘๋น„๋‹ˆ- [์ •์˜ฌ]๋ฌธ์ œํ’€์ด ๊ฒŒ์‹œํŒ ์ด์ชฝ์œผ๋กœ ๋ฐฉ๋ฌธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค:)

2019.03.17 ๊ฒŒ์‹œ๋จ

Coding_Algorithm/์ •์˜ฌ ๋ฌธ์ œํ’€์ด

[์ •์˜ฌ] ๊ธฐ์ดˆ๋‹ค์ง€๊ธฐ_์„ ํƒ์ œ์–ด๋ฌธ_ํ˜•์„ฑํ‰๊ฐ€1_code120

[์ •์˜ฌ] ๊ธฐ์ดˆ๋‹ค์ง€๊ธฐ_์„ ํƒ์ œ์–ด๋ฌธ_ํ˜•์„ฑํ‰๊ฐ€1_code120 ๋‘ ๊ฐœ์˜ ์ •์ˆ˜๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ ํฐ ์ˆ˜์—์„œ ์ž‘์€ ์ˆ˜๋ฅผ ๋บ€ ์ฐจ๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. 50 8535 [์ •๋‹ต ์ฝ”๋“œ-C์–ธ์–ด] #include int main(){int a, b;scanf("%d %d", &a, &b);if (a >= b)printf("%d", a - b);if (b > a)printf("%d", b - a);return 0;} C++, Java, Python๋“ฑ์˜ ๋‹ค๋ฅธ ์–ธ์–ด๋“ค์€ ๊ณ„์† ์—…๋ฐ์ดํŠธ ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ถ๊ธˆํ•˜์‹ ์ ์€ ์–ธ์ œ๋‚˜ ์งˆ๋ฌธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

2019.03.17 ๊ฒŒ์‹œ๋จ

Coding_Algorithm/์ •์˜ฌ ๋ฌธ์ œํ’€์ด

[์ •์˜ฌ] ๊ธฐ์ดˆ๋‹ค์ง€๊ธฐ_์—ฐ์‚ฐ์ž_ํ˜•์„ฑํ‰๊ฐ€3_code113

[์ •์˜ฌ]๊ธฐ์ดˆ๋‹ค์ง€๊ธฐ_์—ฐ์‚ฐ์ž_ํ˜•์„ฑํ‰๊ฐ€3_code113 ์ง์‚ฌ๊ฐํ˜•์˜ ๊ฐ€๋กœ์™€ ์„ธ๋กœ์˜ ๊ธธ์ด๋ฅผ ์ •์ˆ˜ํ˜• ๊ฐ’์œผ๋กœ ์ž…๋ ฅ๋ฐ›์€ ํ›„ ๊ฐ€๋กœ์˜ ๊ธธ์ด๋Š” 5 ์ฆ๊ฐ€์‹œํ‚ค๊ณ  ์„ธ๋กœ์˜ ๊ธธ์ด๋Š” 2๋ฐฐํ•˜์—ฌ ์ €์žฅํ•œ ํ›„ ๊ฐ€๋กœ์˜ ๊ธธ์ด ์„ธ๋กœ์˜ ๊ธธ์ด ๋„“์ด๋ฅผ ์ฐจ๋ก€๋กœ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. 20 15width = 25 length = 30 area = 750 [์ •๋‹ต ์ฝ”๋“œ-C์–ธ์–ด] #include int main(){int width, length;scanf("%d %d", &width, &length);width = width + 5;length = length * 2;printf("width: %d\n", width);printf("length: %d\n", length);printf("area: %d\n", width * length);return..

2019.03.17 ๊ฒŒ์‹œ๋จ