Javascript
배열 Array(예시 평균 온도 구하기, 배열 다음 for문)
Linda~!
2020. 3. 11. 10:51

평균 온도 구하기
See the Pen VwLQKLz by MoonSeonhyeon (@Seonhyeon) on CodePen.
배열 다음 for문
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
package myapp;
public class Ex2 {
public static void main(String[] args) {
// 배열 : 동일한 타입의 값들을 하나의 변수 사용하기 위한 목적(아파트)
int arr[] = {1,2,3,4,5};
System.out.println(arr[0]);
System.out.println(arr[1]);
//배열 밑에는 항상 for가 있다(JSPStudy)
for (int i = 0; i < arr.length; i++) {
System.out.println(arr[i]);
}
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |