Last active
May 21, 2017 10:14
-
-
Save adler3d/d9046acd87f91247e6928382d50f69c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline string IToS(const int&val) | |
{ | |
if(!val)return "0";char c[16]={0};int p=0;int v=val;int n=10;if(val<0){v*=-1;} | |
for(;v;){c[p++]='0'+v%n;v/=n;}if(val<0)c[p++]='-'; | |
string s;s.resize(p);for(int i=0;i<p;i++)s[i]=c[(p-1)-i]; | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment