Skip to content

Instantly share code, notes, and snippets.

@RadianSmile
Created November 28, 2016 14:56
Show Gist options
  • Save RadianSmile/6207bb3df69c01b95eae83c5abb6e272 to your computer and use it in GitHub Desktop.
Save RadianSmile/6207bb3df69c01b95eae83c5abb6e272 to your computer and use it in GitHub Desktop.
array 練習題
  1. 宣告一個裝 int 的 array ,有 5 格

  2. 格子依序填進 1 ~ 5

  3. 把每一個格子都 + 1

@evapreciosa
Copy link

int []array = new int[5];
for(int i=0; i<5; i++){
array[i]= i+1;
}
for(int i=0; i<5; i++){
array[i]++;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment