結果

問題 No.1942 Leading zero
ユーザー karinohito
提出日時 2022-05-21 00:30:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 1,741 ms
コンパイル使用メモリ 194,460 KB
最終ジャッジ日時 2025-01-29 12:21:45
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(A) A.begin(),A.end()
#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)



int main() {
    ll N;
    cin>>N;
    rep(n,N){
        string S;
        cin>>S;
        bool C=false;
        rep(s,S.size()){
            if(S[s]!='0')C=1;
            if(C)cout<<S[s];
        }
        if(!C)cout<<0;
        cout<<endl;
    }
    
}
0