結果

問題 No.1942 Leading zero
ユーザー myirumyiru
提出日時 2022-05-24 21:49:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 729 bytes
コンパイル時間 1,632 ms
コンパイル使用メモリ 170,496 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 18:56:42
合計ジャッジ時間 2,112 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

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