![[컴퓨터 구조] 레지스터](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FWpL61%2Fbtr6bt4vkLN%2FprJPbuOkqMzfoTjDKTBKY0%2Fimg.jpg)
이 글은 혼자 공부하는 컴퓨터 구조 + 운영체제 (저자 : 강민철)의 책과 유튜브 영상을 참고하여 개인적으로 정리하는 글임을 알립니다. 반드시 알아야 할 레지스터 프로그램 카운터 명령어 레지스터 메모리 주소 레지스터 메모리 버퍼 레지스터 플래그 레지스터 범용 레지스터 스택 포인터 베이스 레지스터 프로그램 카운터 메모리에서 가져올 명령어의 주소(메모리에서 읽어 들일 명령어의 주소)를 저장 프로그램 카운터를 명령어 포인터라고 부르는 CPU도 있음 명령어 레지스터 방금 읽어 들어 들인 명령어를 저장하는 레지스터 제어장치는 명령어 레지스터 속 명령어를 받아들이고 해석한 뒤 제어 신호를 내보냄 메모리 주소 레지스터 메모리의 주소를 저장하는 레지스터 CPU가 읽고자 하는 주소 값을 주소 버스로 보낼 때 메모리 주소..
![[C++] 백준 4단계 - 5597번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FE49JT%2Fbtr6eVMXvQb%2FENEGJrmNs4qrIkWhjcQm6K%2Fimg.png)
문제설명 소스코드 #include using namespace std; int main() { int arr[30] = { 0 }; int input = 0; for (int i = 0; i > input; arr[input - 1] = 1; } for (int i = 0; i < 30; ++i) if (arr[i] != 1) cout
![[C++] 백준 4단계 - 10810번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FFA9Uy%2Fbtr5QAoYv1a%2FaHOrJr3IvIVNHsgIHAwh80%2Fimg.png)
문제설명 소스코드 #include using namespace std; int arr[101]; int N, M; int main() { cin >> N >> M; while (M--) { int i, j, k; cin >> i >> j >> k; for (int u = i; u
![[C++] 백준 4단계 - 2562번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb0JABy%2Fbtr5O9efwMg%2F9VIS56mKzVfJ6RZKthHMM0%2Fimg.png)
문제설명 소스코드 #include using namespace std; int main() { int max = 0; int idx; int arr[9]; for (int i = 0; i > arr[i]; if (arr[i] > max) { max = arr[i]; idx = i; } } cout
![[C++] 백준 4단계 - 10818번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcenQ92%2Fbtr591ylVeA%2FZBOIfFdIova8Caq3WrlCqk%2Fimg.png)
문제설명 소스코드 #include using namespace std; int main() { int N; int max; int min; cin >> N; int* arr = new int[N]; for (int i = 0; i > arr[i]; max = min = arr[0]; for (int i = 0; i max) max = arr[i]; if (arr[i] < min) min = arr[i]; } cout
![[C++] 백준 4단계 - 10871번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmA85i%2Fbtr5TnPPNXm%2FAGwYjzPFh32P6uzsaiIjBk%2Fimg.png)
문제설명 소스코드 #include using namespace std; int main() { int N; int X; cin >> N >> X; int* arr = new int[N]; for (int i = 0; i > arr[i]; for (int i = 0; i < N; ++i) if (arr[i] < X) cout
![[C++] 백준 4단계 - 10807번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcnhJ0i%2Fbtr5TqZ5UYI%2F9VNYV7Tndlx34BppTrPRp0%2Fimg.png)
문제설명 소스코드 #include using namespace std; int main() { int arrlength; int num = 0; int input; cin >> arrlength; int* arr = new int[arrlength]; for (int i = 0; i > arr[i]; cin >> input; for (int i = 0; i < arrlength; ++i) if (input == arr[i]) ++num; cout
![[C++] 백준 3단계 - 10951번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbpADzg%2Fbtr5Tn3ncD9%2FmhxWjiy8yXr6Q6DGUCQPw1%2Fimg.png)
문제설명 소스코드 #include using namespace std; int main() { int a, b; while (!(cin >> a >> b).eof()) cout val; cout > a >> b).eof() 방식으로 괄호 안의 cin >> a >> b를 통해 읽은 후 eof상태인지를 검사하는 것이다. 따라서 아래와 같이 소스코드를 작성해야한다. while(!(cin >> a >> b).eof()) { ... } 출처 : https://st-lab.tistory.com/257