Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include "conio.h"
- using namespace std;
- int main()
- {
- char c;
- int k, y;
- double d = 0;
- bool OK = false;
- int n = 0;
- cin >> n;
- c = char(0);
- while (c != char(13))
- {
- OK = false;
- c = getch();
- cout << c;
- if ((c >= '0') && (c <= '9'))
- {
- y = int (c) - int ('0');
- OK = true;
- }
- else
- if ((c >= 'a') && (c <= 'z'))
- {
- OK = true;
- y = (int)c - 87;
- }
- if (OK) d = d * n + y;
- }
- cout << endl;
- cout << d;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment