思路:
ACcode:
#include<bits/stdc++.h>
using namespace std;
#define int long long
string s;
void solve() {
cin>>s;
s="00"+s;
int len=s.size();
for(int i=0; i<len; i++) {
for(int j=i+1; j<len; j++) {
for(int k=j+1; k<len; k++) {
int x=s[i]*100+s[j]*10+s[k]-111*'0';
if(x%8==0) {
cout<<"YES\n"<<x<<"\n";
return;
}
}
}
}
cout<<"NO\n";
}
signed main() {
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int t=1;
//cin>>t;
while(t--) {
solve();
}
return 0;
}
over~