結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
![]() |
提出日時 | 2019-02-21 20:13:39 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 491 bytes |
コンパイル時間 | 2,466 ms |
コンパイル使用メモリ | 106,144 KB |
実行使用メモリ | 25,428 KB |
最終ジャッジ日時 | 2024-11-20 20:21:01 |
合計ジャッジ時間 | 3,371 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; public class Hello { static void Main() { var s = Console.ReadLine().Trim(); var a = s.Length % 3; if (a != 0) Console.Write(s.Substring(0, a) + ","); put3N(s.Substring(a)); } static void put3N(string s) { var sL = s.Length; for (int i = 0; i < sL; i++) { Console.Write(s[i]); if (i % 3 == 2 && i != sL - 1) Console.Write(','); } Console.WriteLine(); } }