結果
問題 |
No.637 X: Yet Another FizzBuzz Problem
|
ユーザー |
![]() |
提出日時 | 2018-05-25 10:15:23 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 494 bytes |
コンパイル時間 | 2,636 ms |
コンパイル使用メモリ | 74,392 KB |
実行使用メモリ | 41,748 KB |
最終ジャッジ日時 | 2024-06-28 17:53:13 |
合計ジャッジ時間 | 7,697 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 30 |
ソースコード
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] a = new int[5]; int result=0; for (int i=0;i<5 ;i++ ) { a[i] = sc.nextInt(); } for (int j=0;j<5 ;j++ ) { if (a[j]%3==0&&a[j]%5==0) { result+=8; }else if(a[j]%3==0){ result+=4; }else if(a[j]%5==0){ result+=4; }else{ result+=a[j]; } } System.out.println(result); } }