w tym programie nie potrafie go zakonczyc
#include <iostream>
#include<cstring>
#include <cmath>
using namespace std;
int main() {
int tab[50];
int L = 0;
string Cyfry;
cout << "Wprowadz liczbe w systemie 16:" << endl;
cin >> Cyfry;
for(int i=0; i<Cyfry.length(); i++)
{
if((int)(Cyfry[Cyfry.length()-1-i])<58)
tab[i] = (int)(Cyfry[Cyfry.length()-1-i])-48;
else tab[i] = (int)(Cyfry[Cyfry.length()-1-i])-55;
if(tab[i]<0 || tab[i]>15){ //sprawdzanie poprawno?ci podanej liczby
cout<<"To nie jest liczba w systemie 16"<<endl;
system("pause");
return 0;
}
}
for (int j=0; j<Cyfry.length(); j++) {
L = L + (tab[j] * pow(16, j));
};
cout << "Wynik: " << L << endl;
system("pause");
return 0;
}