結果
問題 | No.188 HAPPY DAY |
ユーザー |
![]() |
提出日時 | 2018-02-08 21:53:38 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 117 ms / 1,000 ms |
コード長 | 831 bytes |
コンパイル時間 | 2,446 ms |
コンパイル使用メモリ | 77,008 KB |
実行使用メモリ | 41,568 KB |
最終ジャッジ日時 | 2024-09-25 11:46:10 |
合計ジャッジ時間 | 3,071 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
import java.util.*;public class Main {static Scanner sc = new Scanner(System.in);public static void main(String[] args) {int count = 0;for (int i=1; i<=12; i++) {if (i==2) { //-28for (int j=1; j<=28; j++) {int temp = 0;if (j>=10) {temp = j/10 + j%10;}else {temp = j;}if (i==temp) {count++;}}}else if (i==4 || i==6 || i==9 || i==11) { //-30for (int j=1; j<=30; j++) {int temp = 0;if (j>=10) {temp = j/10 + j%10;}else {temp = j;}if (i==temp) {count++;}}}else { //-31for (int j=1; j<=31; j++) {int temp = 0;if (j>=10) {temp = j/10 + j%10;}else {temp = j;}if (i==temp) {count++;}}}}System.out.println(count);}}