結果

問題 No.1942 Leading zero
ユーザー myirumyiru
提出日時 2022-05-24 21:56:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 759 bytes
コンパイル時間 3,030 ms
コンパイル使用メモリ 170,440 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 18:56:46
合計ジャッジ時間 2,185 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 17 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;string s[10001];
    for(int i=0;i<n;i++){cin>>s[i];
        if(s[i].at(0)=='0'&&s[i].at(1)=='0'&&s[i].at(2)=='0'&&s[i].at(3)=='0'&&s[i].at(4)=='0')
        {cout<<"0"<<endl;}
        else if(s[i].at(0)=='0'&&s[i].at(1)=='0'&&s[i].at(2)=='0'&&s[i].at(3)=='0')
        {cout<<s[i].at(4)<<endl;}
        else if(s[i].at(0)=='0'&&s[i].at(1)=='0'&&s[i].at(2)=='0')
        {cout<<s[i].at(3)<<s[i].at(4)<<endl;}
        else if(s[i].at(0)=='0'&&s[i].at(1)=='0')
          {cout<<s[i].at(2)<<s[i].at(3)<<s[i].at(4)<<endl;}
          else if(s[i].at(0)=='0')
          {cout<<s[i].at(1)<<s[i].at(2)<<s[i].at(3)<<s[i].at(4)<<endl;}
          else{cout<<s[i]<<endl;}
    }
    return 0;
}
0