๋ชฉ๋ก์ ์ฒด ๊ธ (244)
๐ท๐ผ๋ชจ์ฌ๋ด์ ๊ฐ๋ฐ์์ฒ๐ท๐ผ
JSTL ํฉ๊ณ ๊ณ์ฐ jsp์์ ๋จ์ํ ํ๋ฉด์์ ํ๋จ์ ํฉ๊ณ๋ฅผ ๊ตฌํ๋ ๊ฒฝ์ฐ ๋ฅผ ์ด์ฉํ ๊ฒฐ๊ณผ๋ฅผ ๊ตฌํ๋ ๋ฐฉ๋ฒ JSTL // ๋ณ์ ์ ์ธ // ์์ ${test.column_id} ์ถ์ฒ: https://javafactory.tistory.com/964 [FreeLife์ ์ ์ฅ์]
tileGrid๋ก ๊ณ์ฐ์ y๊ฐ์ด ์์๋ก ์กํ๊ธฐ ๋๋ฌธ์ ์ด๋ฅผ Math.ads(y) ๋ฅผ ์ด์ฉํด y๋ฅผ ์ ๋๊ฐ์ผ๋ก ๋ฐ๊ฟ์ค ํ ๊ณ์ฐํฉ๋๋ค. ์ ๊ฐ ๋ณด์ฌ์ค ์ง๋ ๋ฒ์๋ฅผ tileGrid ์ค๋ ๋ฒจ 5 ๊ธฐ์ค์ผ๋ก mapBounds์ ๋ด์ต๋๋ค ์ค๋ ๋ฒจ์ด 1์ฉ ์ค๋ฅผ์๋ก tileGrid์ x, y๊ฐ์ 2๊ฐ ๋ ๊ณฑํด์ง๋๋ค. ์๋ฅผ๋ค์ด, coordinate๊ฐ [5, 26, 11] ์ด๋ ๊ฒ ๋๋ค๋ฉด ์ค ๋ ๋ฒจ์ 1 ์ฌ๋ ธ์๋ [6, 52, 22] ์ด๋ ๊ฒ ๋ฉ๋๋ค. ๊ทธ๋์ ์ค๋ ๋ฒจ์ ๋ฐ๋ผ ๋งต์ ๋ณด์ฌ์ค extent๊ฐ์ด ๋ฌ๋ผ์ง๊ฒ ๋ฉ๋๋ค. ์ค๋ ๋ฒจ์ด 5์์ 6์ด ๋๋ค๋ฉด ์์ ํ 2๋ฅผ ๊ณฑํ๋ฉด ๋์ง๋ง 5์์ 8์ด ๋๋ค๋ฉด ์๊ธฐ๊ฐ ๋ฌ๋ผ์ง๋๋ค 5๋ ๋ฒจ์ ๊ฐ์์ 2๋ฅผ ๊ณฑํ๊ณ ๊ทธ์ 2๋ฅผ ๊ณฑํ๊ณ ๋ 2๋ฅผ ๊ณฑํด์ผ ํฉ๋๋ค. ๋ฐ๋ผ์, ์ค ๋ ๋ฒจ์ด ์ด๋ค ์๊ฐ ๋ค์ด์ฌ์ง ๋ชจ๋ฅด๋ ๊ณ์ฐํ์ฌ์ผ..

๊ฐ๋์ ์ฐจ๊ทผ์ฐจ๊ทผ ์์ผ๋ก ๋๋ฒ๊น ํ๋๊ฒ ์ข์ ๋ฐฉ๋ฒ์ผ์ง๋ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. /* 26๋ถํฐ ์์ํ๋ค. 2+6 = 8์ด๋ค. ์๋ก์ด ์๋ 68์ด๋ค. 6+8 = 14์ด๋ค. ์๋ก์ด ์๋ 84์ด๋ค. 8+4 = 12์ด๋ค. ์๋ก์ด ์๋ 42์ด๋ค. 4+2 = 6์ด๋ค. ์๋ก์ด ์๋ 26์ด๋ค. ์์ ์๋ 4๋ฒ๋ง์ ์๋ ์๋ก ๋์์ฌ ์ ์๋ค. ๋ฐ๋ผ์ 26์ ์ฌ์ดํด์ ๊ธธ์ด๋ 4์ด๋ค. N์ด ์ฃผ์ด์ก์ ๋, N์ ์ฌ์ดํด์ ๊ธธ์ด๋ฅผ ๊ตฌํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค. */ #include #include using namespace std; int main(){ // ์ฌ์ดํด ํ์ int cycle = 1; // ์๋กญ๊ฒ ๋ง๋ ์์ ๋ท์๋ฆฌ int re = 0; // ์ ๋ ฅ๋ฐ์ ์ซ์ int num = 0; // ๋ํ ๊ฒฐ๊ณผ int result = 0; //..

#include using namespace std; int main() { int a, b; while(cin>>a>>b){ cout

#include using namespace std; int main() { int n, x, r = 0; cin >> n >> x; // ์์ด์ ๋ด์ ๋ฐฐ์ด int array[n]; // ๊ฒฐ๊ณผ๊ฐ์ ๋ด์ ๋ฐฐ์ด int result[n]; // ์์ด์ ์ ๋ ฅ๋ฐ๋๋ค for(int i=0; i> array[i]; } // ์ ๋ ฅ๋ฐ์ ์์ด์ค x๋ณด๋ค ์์ ์๋ฅผ ์ฐพ์ ๊ฒฐ๊ณผ๊ฐ์ ๋ฐฐ์ด์ ๋ด๋๋ค for(int i=0; i

#include #include using namespace std; int main() { int t, a, b = 0; //ํ ์คํธ์ผ์ด์ค๊ฐฏ์ cin >> t; // ๊ฒฐ๊ณผ๋ฅผ ๋ด์ ๋ฐฐ์ด string array[t]; for(int i=0; i> a >> b; // ๊ฒฐ๊ณผ ๋ด๊ธฐ array[i] = "Case #" + to_string(i+1) + ": " + to_string(a) + " + " + to_string(b) + " = " + to_string(a+b); } // ๊ฒฐ๊ณผ์ถ๋ ฅ for(int i=0; i

#include using namespace std; int main() { int t, a, b = 0; // ํ ์คํธ ์ผ์ด์ค ๊ฐฏ์ cin >> t; // ๊ฒฐ๊ณผ๋ฅผ ๋ด์ ๋ฐฐ์ด int array[t]; // ํ ์คํธ ์ผ์ด์ค ๊ฐฏ์๋งํผ ์ ๋ ฅ์ ๋ฐ์๋ค์ ๊ฒฐ๊ณผ๊ฐ์ ๋ฐฐ์ด์ ๋ด๋๋ค for(int i=0; i> a >> b; array[i] = a+b; } // ๋ฐฐ์ด ์ถ๋ ฅ for(int i=0; i

#include using namespace std; int main() { int a, b, c; int mid; cin >> a >> b >> c; if (a 100 || b > 100 || c > 100) return 0; if (a >= b) { mid = (b >= c) ? b : (a >= c) ? c : a; } else // b>a { mid = (a >= c) ? a : (b >= c) ? c : b; } cout

#include using namespace std; int main() { int a = 0; int b = 0; // ์ , ๋ถ ์ ๋ ฅ cin >> a >> b; // b์ 45๋ฅผ ๋บ์๋ 0๋ณด๋ค ์์ผ๋ฉด if((b-45)

#include using namespace std; int main() { int a = 0; cin >> a ; // 4์ ๋ฐฐ์์ด๋ค ๊ทธ๋ฆฌ๊ณ 100์ ๋ฐฐ์๊ฐ์๋๋ค // ๋๋ 400์ ๋ฐฐ์์ด๋ค if(((a % 4 == 0) && (a % 100 != 0) || (a % 400 == 0) )){ std::cout