SHARE
TWEET

Untitled

a guest Dec 11th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     char chVal;
  2.     int sum = 0;   
  3.     int chIndex;
  4.     int polje[50];
  5.     int brojac = 0;
  6.     do{
  7.         scanf("%c", &chVal);
  8.         if ((chVal >= '0') && (chVal <= '9')) {
  9.             chIndex = chVal - '0';
  10.         }
  11.         else if ((chVal >= 'a') && (chVal <= 'z')) {
  12.             chIndex = chVal - 'a' + 10;
  13.         }
  14.         else if ((chVal >= 'A') && (chVal <= 'Z')) {
  15.             chIndex = chVal - 'A' + 10;
  16.         }
  17.         polje[brojac] = chIndex;
  18.         brojac ++;
  19.     }while (chVal != ' ' || chVal !='\n');
  20.  
  21.     int i;
  22.     for (i = 0; i < brojac; i++){
  23.         suma = suma + pow(polje[i] , brojac);
  24.         brojac -- ;
  25.     }
  26.     return 0;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top