Created
November 19, 2013 20:09
-
-
Save dafr32/7551699 to your computer and use it in GitHub Desktop.
Horner
This file contains 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
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