06장_배열과%20포인터

# Cpp 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: = " << tot <<"\n"; cout << "평균 = " << avg <<"\n"; } -7- IT COOKBOOK [실습하기 6-3] 배열을 사용하여 최대값 구하기 [예제 6-3] 6_3.cpp 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #include<iostream> using namespace std; void main() { int a[5]; int max; int i; cout << "정수형 데이터를 5개 입력하라\n"; for(i=0; i<5; i++){ cout << "a[ " << i <<" ] => "; cin >> a[i]; } max = a[0]; for(i=1; i<5; i++) if(a[i] > max) max=a[i]; cout << "최대값 => " << max <<"\n"; } -8- IT COOKBOOK 2) 2차원 배열 IT COOKBOOK 2차원 배열의 개념과 선언 -9- 2) 2차원 배열 IT COOKBOOK 2차원 배열의 초기화 - 10 - [실습하기 6-4] 2차원 배열을 초기화하고 출력하기 [예제 6-4] 6_4.cpp 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 #include<iostream.h> #defin...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern