using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
string s;
cin >> s;
int r=0;
bool t=false;
for (char c : s)
{
r+=c-'0';
if (c=='0')
t=true;
}
if (!t or r%3!=0)
{
cout << -1;
} else
{
sort(s.rbegin(), s.rend());
cout<<s;
}
return 0;
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
string s;
cin >> s;
int r=0;
bool t=false;
for (char c : s)
{
r+=c-'0';
if (c=='0')
t=true;
}
if (!t or r%3!=0)
{
cout << -1;
} else
{
sort(s.rbegin(), s.rend());
cout<<s;
}
return 0;
This comment is hidden due to too much negative feedback. Click here to view it.
Đang trả lời bình luận
This comment is hidden due to too much negative feedback. Click here to view it.
Đang trả lời bình luận
This comment is hidden due to too much negative feedback. Click here to view it.
Đang trả lời bình luận
This comment is hidden due to too much negative feedback. Click here to view it.
Đang trả lời bình luận
This comment is hidden due to too much negative feedback. Click here to view it.
Đang trả lời bình luận
Đang trả lời bình luận
yamatekudasai
Đang trả lời bình luận
yamatekudasai
Đang trả lời bình luận
skibidi
Đang trả lời bình luận
sbidi
Đang trả lời bình luận
sbidi
Đang trả lời bình luận
include <bits/stdc++.h>
using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s; cin >> s; int r=0; bool t=false; for (char c : s) { r+=c-'0'; if (c=='0') t=true; }
}
Đang trả lời bình luận
include <bits/stdc++.h>
using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s; cin >> s; int r=0; bool t=false; for (char c : s) { r+=c-'0'; if (c=='0') t=true; }
}
Đang trả lời bình luận
gg
Đang trả lời bình luận
include<bits/stdc++.h>
using namespace std; int main() { long long n; cin>>n; vector<long long> a(n); long long s=0,dem=0; for(int i=0;i<n;i++) { cin>>a[i]; if(a[i]>s) { s=a[i]; dem=1; } else if(a[i]==s) { dem++; } } cout<<dem<<endl; }
Đang trả lời bình luận
include<bits/stdc++.h>
using namespace std; int main() { long long n; cin>>n; vector<long long> a(n); long long s=0,dem=0; for(int i=0;i<n;i++) { cin>>a[i]; if(a[i]>s) { s=a[i]; dem=1; } else if(a[i]==s) { dem++; } } cout<<dem<<endl; }
Đang trả lời bình luận