标签:argc class submit alt 状态 content cin splay begin
20
5
4
#include <iostream> #include <string> #include <algorithm> using namespace std; string Multiply(string s,int x){ reverse(s.begin(),s.end()); int cmp=0; for(int i=0;i<s.size();i++){ cmp=(s[i]-‘0‘)*x+cmp; s[i]=(cmp%10+‘0‘); cmp/=10; } while(cmp){ s+=(cmp%10+‘0‘); cmp/=10; } reverse(s.begin(),s.end()); return s; } string Except(string s,int x){ int cmp=0,ok=0; string ans=""; for(int i=0;i<s.size();i++){ cmp=(cmp*10+s[i]-‘0‘); if(cmp>=x){ ok=1; ans+=(cmp/x+‘0‘); cmp%=x; } else if(ok==1)ans+=‘0‘; } return ans.empty()?"0":ans; } int main(int argc, char *argv[]) { string a; int b; cin>>a>>b; cout<<Except(a,b)<<endl; }
标签:argc class submit alt 状态 content cin splay begin
原文地址:https://www.cnblogs.com/Rhythm-/p/9348895.html