fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.11s 52504KB
stdin
(defun fortunecookie ()
  (princ "202300717名前または学籍番号を入力:")
  (let* ((id (read-line))
         ;; 2025-06-17日付を取得(YYYY-MM-DD形式)
         (date (multiple-value-bind (sec min hour day month year)
                    (get-decoded-time)
                  (format nil "~4,'0d-~2,'0d-~2,'0d" year month day)))
         ;; IDと日付を結合して種を作成
         (combined (concatenate 'string id date))
         ;; シードを生成(各文字のコードを足し合わせる)
         (seed (reduce #'+ (map 'list #'char-code combined)))
         (result (nth (mod seed 5)
                      '("大吉! 挑戦を続けよう"
                        "中吉! 今日は集中の日"
                        "小吉! まずは一歩"
                        "吉! 粘り勝ちを目指そう"
                        "凶…でも明日がある!"))))
    (format t "結果:~A~%" result)))
stdout
Standard output is empty