Untitled
ducsieumanh1hitlanamguku
plain_text
10 months ago
325 B
5
Indexable
int tinh2 (int c,int base,int n) { int tong=n/(base*10); int cur=(n/base)%10; int ans=n%base; int dem=tong*base; if (c<cur) { dem+=base; } else if (c==cur) { dem+=ans+1; } if (c==0) { dem-=base; if (tong==0) return 0; } return dem; }
Editor is loading...
Leave a Comment