This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class SushiYa{ | |
static void vote(){ | |
System.out.println("�ӉZ���i"); | |
} | |
} | |
class Daisou extends SushiYa{ | |
static void vote(){ | |
System.out.println("���m���i"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hoge{ | |
public static void main(String args[]){ | |
int max = 500; //上限 | |
int hantei = 0; | |
int n = 0; | |
int i = 0; | |
for(i = 0; i < max; i++){ | |
n =(int)(Math.random()*3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
あ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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回繰り返す |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
class myPanel extends JPanel implements ActionListener, KeyListener{ | |
int x = 30, y = 20; | |
int dx = 12, dy = 5, d = 30; | |
int padY = 55; | |
int pd = 0; | |
Timer pTimer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EvenException extends Exception{}; | |
class OddException extends Exception{}; | |
class Even{ | |
static void isEven(int i) throws EvenException, OddException{ | |
if(i%2 == 0){ | |
throw new EvenException(); | |
}else{ | |
throw new OddException(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CosWave{ | |
public static void main(String[] args){ | |
int n = Integer.parseInt(System.console().readLine("いくつまでやりますか? ->")); | |
double PI = 3.14; | |
for(int i = 0; i < n; i ++){ | |
try{ | |
Thread.sleep(100); | |
}catch(InterruptedException e){} | |
int m = 10+(int)(10*Math.cos(PI*i/10)); | |
for(int j = 0; j < m; j++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FizzBuzz{ | |
public static void main(String[] args){ | |
int n = Integer.parseInt(System.console().readLine("いくつまでやりますか? ")); | |
for(int i = 1; i <= n ;i++ ){ | |
if(i%3==0) | |
System.out.print("Fizz"); | |
if(i%5==0) | |
System.out.print("Buzz"); | |
if(i%3!=0 && i%5!=0) | |
System.out.print(i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PhotoBooth{ | |
public static void main(String[] args){ | |
System.out.println("【プリクラ問題】"); | |
System.out.println("n人のメンバーが"); | |
System.out.println("m人は入れるプリクラで"); | |
System.out.println("それぞれが他の各メンバーと"); | |
System.out.println("同じ写真に収まるには"); | |
System.out.println("何回の撮影が必要か\n"); | |