提交时间:2023-05-20 15:10:03

运行 ID: 74062

#include<bits/stdc++.h> using namespace std; int a,t,ans; int main(){ cin>>a; ans=a; while(1){ t+=ans%10; ans/=10; if(ans==0) break; } t-=1; if(t==0){ cout<<"0"; return 0; }else{ if(a%10==0) cout<<a-10; else cout<<a-1; } return 0; }