Skip to content

Instantly share code, notes, and snippets.

@takanakahiko
Last active August 29, 2015 14:13
Show Gist options
  • Save takanakahiko/7149bb78b75b92a0c584 to your computer and use it in GitHub Desktop.
Save takanakahiko/7149bb78b75b92a0c584 to your computer and use it in GitHub Desktop.
繰り返しの繰り返し
class ForFor{
public static void main(String[] args){
System.out.println("a回繰り返す中でb回繰り返すよ!");
int a = Integer.parseInt(System.console().readLine("a="));
int b = Integer.parseInt(System.console().readLine("b="));
for(int i = 0; i < a; i++){ //a回繰り返す
for(int j = 0; j < b; j++){ //b回繰り返す
System.out.printf("i:%d\tj:%d\n",i,j);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment