C, C++/๐Ÿฅ‰ BOJ6

(C++)โ˜…Sorting Upper-Beginner I - 1 Solvedโ˜… โ˜… 2750 ์ˆ˜ ์ •๋ ฌํ•˜๊ธฐ โ˜…//1436#include #include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N; cin >> N; vector arr{}; while(N--){ int x; cin >> x; arr.push_back(x); } sort(arr.begin(),arr.end()); for(int x=0;x ๐Ÿ‘ฏโ€โ™‚๏ธ vector arr{}๋กœ ๊ฐ€๋ณ€ ๋ฐฐ์—ด ๋งŒ๋“ค๊ณ  push_back()์œผ๋กœ ์—…๋ฐ์ดํŠธ. ์ด.. C, C++/๐Ÿฅ‰ BOJ 2024. 11. 14.
(C++)โ˜…Math & Geometry Upper-Beginner I - 1 Solvedโ˜… โ˜… 14215 ์„ธ ๋ง‰๋Œ€ โ˜…//14215#include #include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int arr[3]; cin >> arr[0] >> arr[1] >> arr[2]; sort(arr, arr+3); if((arr[0]+arr[1]) ๐Ÿค™ sort(arr, arr+3)๋กœ ์ฃผ์–ด์ง„ ๋ฐฐ์—ด์˜ ๊ธธ์ด๋ฅผ sortingํ•  ์ˆ˜ ์žˆ๋‹ค. ๐Ÿค™ cin >> arr[0] >> arr[1] >> arr[2]๋กœ ์ง์ ‘ ์ž…๋ ฅํ•œ ์ˆซ์ž ์ž์ฒด๋ฅผ ๋ฐ”๋กœ ๋ฐฐ์—ด์— ๋„ฃ์„ ์ˆ˜ ์žˆ๋‹ค. .. C, C++/๐Ÿฅ‰ BOJ 2024. 11. 14.
(C++) โ˜…Number Theory Upper-Beginner I - 3 Solvedโ˜… โ˜… 9506 ์•ฝ์ˆ˜๋“ค์˜ ํ•ฉ โ˜…//9506#include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,total; while(1){ cin >> n; if(n==-1){ break; } total = 1; vector numbers = {}; for(int x=2;x ๐Ÿงšโ€โ™‚๏ธ ๊ฐ€๋ณ€ ๋ฐฐ์—ด vector numbers = {} ๋งŒ๋“ค์–ด ๋†“๊ณ , ์•ฝ์ˆ˜์ผ ๋•Œ numbers.push_back(x); ์‚ฌ์šฉ.. C, C++/๐Ÿฅ‰ BOJ 2024. 11. 14.
(C++) โ˜…Implementation Upper-Beginner I - 8 Solvedโ˜… โ˜… 10811 ๋ฐ”๊ตฌ๋‹ˆ ๋’ค์ง‘๊ธฐ โ˜…#include #include using namespace std;void swap(int *a, int *b){ int tmp = *a; *a = *b; *b = tmp;}int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, M; cin >> N >> M; int* basket = new int[N]; for(int x = 0; x > i >> j; for(int a = 0; a  ๐Ÿค ๋ฐ”๊ตฌ๋‹ˆ i๋ถ€ํ„ฐ ๋ฐ”๊ตฌ๋‹ˆ j๊นŒ์ง€ ์—ญ์ˆœ์œผ๋กœ ๋„ฃ๋Š” ๋ฐฉ๋ฒ•์€, iterator x๊ฐ€ ๋ฐ”๊ตฌ๋‹ˆ i๋ถ€ํ„ฐ (i+j)/2๊นŒ์ง€ ๋Œ๋ฉฐ ์–‘ ์˜†(x์™€ ์„.. C, C++/๐Ÿฅ‰ BOJ 2024. 11. 13.
(C++) โ˜…Implementation Beginner I - 28 Solvedโ˜… โ˜… 1330 ๋‘ ์ˆ˜ ๋น„๊ตํ•˜๊ธฐ โ˜…//1330#include #include using namespace std;int main(int argc, char const *argv[]) { int A, B; cin >> A >> B; if (A > B){ cout ' โ˜… 9498 ์‹œํ—˜ ์„ฑ์  โ˜…#include #include using namespace std; int main(int argc, char const *argv[]){ int score; cin >> score; if(score >= 90){ cout = 80){ cout = 70){ cout = 60){ cout โ˜… 2753 ์œค๋…„ โ˜…#include #.. C, C++/๐Ÿฅ‰ BOJ 2024. 11. 13.
(C++) โ˜…Basics I - 16 Solvedโ˜… โ˜… 2557 Hello World โ˜…#include using namespace std;int main(){ cout โ˜… 1000 A + B โ˜… / โ˜… 1001 A - B โ˜… / โ˜… 10998 A x B โ˜…#include using namespace std;int main(){ int A, B; cin >> A; cin >> B; cout โ˜… 1008 A / B โ˜…#include using namespace std;int main(){ double A, B; cin >> A >> B; cout.precision(12); cout  ๐Ÿค cout.precision(12)์œผ๋กœ ์‹ค์ˆ˜ ์ „์ฒด๋ฅผ 12์ž๋ฆฌ๋กœ ํ‘œํ˜„ํ•˜๊ฒ ๋‹ค๋Š” ๋œป.๐Ÿค fixed ์จ์„œ 12์ž๋ฆฌ๋กœ ๊ณ ์ •ํ•œ ์ˆซ์ž๋กœ.. C, C++/๐Ÿฅ‰ BOJ 2024. 11. 13.