#include <bits/stdc++.h> using namespace std; #define ll long long ll n,m,k; string s; string maxx(string a,string b) { while(a[0]=='0') a.replace(0,1,""); while(b[0]=='0') b.replace(0,1,""); if(a=="") return b; if(b=="") return a; if(a.length()>b.length()) return a; if(a.length()<b.length()) return b; if(a>b) return a; if(a<b) return b; return a; } void giai() { string res="",t=""; for(int i=0;i<=s.length()-1;i++) { if('0'<=s[i]&&s[i]<='9') { t=t+s[i]; } else t=""; res=maxx(res,t); //cout<<t<<endl; } cout<<res; } int main() { ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0); freopen("b.inp","r",stdin); freopen("b.OUT","w",stdout); cin>>s; giai(); }
* Chuyên dạy lập trình ONLINE cho học sinh THCS, THPT *.
Mọi giao lưu, trao đổi, xin liên hệ: Lê Quang Vinh - zalo: 037.803.8755.
Page: Lớp học Code Sky
Group FB1: Ôn thi HSG9 - THTB - TS10 chuyên tin
Group FB2: Học Scratch - Ôn thi Tin học trẻ bảng A
Thứ Bảy, 2 tháng 4, 2022
LOCSO c++
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét
Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.