結果
問題 | No.784 「,(カンマ)」 |
ユーザー | heyanxx |
提出日時 | 2019-08-27 10:43:41 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 125 ms / 2,000 ms |
コード長 | 1,139 bytes |
コンパイル時間 | 3,474 ms |
コンパイル使用メモリ | 71,824 KB |
実行使用メモリ | 56,292 KB |
最終ジャッジ日時 | 2023-08-08 23:29:12 |
合計ジャッジ時間 | 6,316 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 123 ms
55,696 KB |
testcase_01 | AC | 124 ms
55,836 KB |
testcase_02 | AC | 124 ms
55,976 KB |
testcase_03 | AC | 124 ms
55,568 KB |
testcase_04 | AC | 125 ms
56,188 KB |
testcase_05 | AC | 123 ms
55,580 KB |
testcase_06 | AC | 123 ms
55,372 KB |
testcase_07 | AC | 122 ms
55,704 KB |
testcase_08 | AC | 122 ms
55,308 KB |
testcase_09 | AC | 123 ms
55,624 KB |
testcase_10 | AC | 121 ms
55,628 KB |
testcase_11 | AC | 124 ms
56,292 KB |
testcase_12 | AC | 122 ms
55,464 KB |
ソースコード
package test.demo; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Date; import java.util.Scanner; public class Yukicoder784 { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ /* * Scanner sc=new Scanner(System.in); int N =sc.nextInt(); if(N>999) { String * str=String.valueOf(N); int a=str.length()%3; if(a!=0) { String * str2=str.substring(0,a)+","; for(int i=a;i<str.length()-a;i=i+3) { * if(i+3>=str.length()) { str2+=str.substring(i,str.length()); }else { * str2+=str.substring(i,i+3)+","; } } System.out.println(str2); }else { String * str2=""; for(int i=0;i<str.length();i=i+3) { if(i+3>=str.length()) { * str2+=str.substring(i,str.length()); }else { str2+=str.substring(i,i+3)+","; * } } System.out.println(str2); } * * }else { System.out.println(N); } */ Scanner stdin = new Scanner(System.in); //System.out.printf("%1$,-3d%n", stdin.nextInt()); //System.out.printf("%tY/%tm/%td%n",new Date(),new Date(),new Date()); System.out.printf("%,d",stdin.nextInt()); } }