Skip to content

Instantly share code, notes, and snippets.

@dafr32
Created November 19, 2013 20:09
Show Gist options
  • Save dafr32/7551699 to your computer and use it in GitHub Desktop.
Save dafr32/7551699 to your computer and use it in GitHub Desktop.
Horner
int horner(string liczba, int s)
{
int suma=0;
for(int i=0;i<liczba.length();i++)
{
if( liczba[i]-48 < 10 )
{
suma=suma*s + (liczba[i]-48);
}
else
suma=suma*s + (liczba[i]-87);
}
return suma;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment