結果
| 問題 |
No.1942 Leading zero
|
| コンテスト | |
| ユーザー |
marimom7
|
| 提出日時 | 2022-06-30 02:27:41 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 439 ms / 2,000 ms |
| コード長 | 890 bytes |
| コンパイル時間 | 16,986 ms |
| コンパイル使用メモリ | 167,036 KB |
| 実行使用メモリ | 211,860 KB |
| 最終ジャッジ日時 | 2024-11-23 18:06:06 |
| 合計ジャッジ時間 | 8,683 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (99 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
public class Program
{
static void Main()
{
// データ初期化
string outputString = "";
// 初期データ入力
string line = System.Console.ReadLine();
// 処理開始
string readString = "";
bool checkZero = false;
for(int i = 0; i < int.Parse(line); i++)
{
readString = System.Console.ReadLine();
checkZero = true;
for(int stcount = 0; stcount < readString.Length; stcount++)
{
// ゼロが終わるまで空回し
if(checkZero) checkZero = readString[stcount] == '0';
if(checkZero) continue;
// 空回しが終わったらデータ作成
outputString += readString[stcount];
}
// 全てが0なら一文字追加する
if(checkZero) outputString += "0";
outputString += "\n";
}
outputString.Remove(outputString.Length - 1);
Console.Write(outputString);
}
}
marimom7