Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- char chVal;
- int sum = 0;
- int chIndex;
- int polje[50];
- int brojac = 0;
- int uvjet;
- do{
- scanf("%c", &chVal);
- if ((chVal >= '0') && (chVal <= '9')) {
- chIndex = chVal - '0';
- }
- else if ((chVal >= 'a') && (chVal <= 'z')) {
- chIndex = chVal - 'a' + 10;
- }
- else if ((chVal >= 'A') && (chVal <= 'Z')) {
- chIndex = chVal - 'A' + 10;
- }
- polje[brojac] = chIndex;
- brojac ++;
- if (chVal == ' '){
- uvjet = 0;
- }
- if (chVal == '\n'){
- uvjet = 0;
- }
- }while (uvjet == 0);
- int i;
- for (i = 0; i < brojac; i++){
- sum = sum + pow(polje[i] , brojac);
- brojac -- ;
- }
- printf("%d", sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement