fork download
  1. class Cleric {
  2. String name;
  3. int hp = 50;
  4. final int MAXHP = 50;
  5. int mp = 10;
  6. final int MAXMP = 10;
  7.  
  8. void selfAid() {
  9. this.mp -= 5;
  10. this.hp = MAXHP;
  11. System.out.println(this.name + "はセルフエイドを唱えた!HPが完全回復した!");
  12. }
  13.  
  14. int pray(int sec) {
  15. int recoverMp = sec + new java.util.Random().nextInt(3);
  16. int recoverMpActual = Math.min(this.MAXMP - this.mp, recoverMp);
  17. System.out.println(this.name + "は" + sec + "秒、天に祈った!MPが" + recoverMpActual + "ポイント回復した!");
  18. return recoverMpActual;
  19. }
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
spoj: The program compiled successfully, but main class was not found.
      Main class should contain method: public static void main (String[] args).
stdout
Standard output is empty