From 773fc032496285e5a823e75b96f5abbd1690bf5b Mon Sep 17 00:00:00 2001 From: Kapil Verma <43838373+kapilk535@users.noreply.github.com> Date: Sun, 24 Oct 2021 20:14:28 +0530 Subject: [PATCH 1/2] Create 17NumberSystemtoDecimal --- 17NumberSystemtoDecimal | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 17NumberSystemtoDecimal diff --git a/17NumberSystemtoDecimal b/17NumberSystemtoDecimal new file mode 100644 index 0000000..7bffb90 --- /dev/null +++ b/17NumberSystemtoDecimal @@ -0,0 +1,31 @@ +#include +using namespace std; +int main(){ + char hex[17]; + long long ans=0,tp1; + int len,val; + + cin>>hex; + + len=strlen(hex); + + for(int i=0;len>0;i++){ + if(hex[i]>='0' && hex[i]<='9'){ + val = (hex[i] - '0'); + } + else if(hex[i]>='a' && hex[i]<='g'){ + val = (hex[i] - 'a')+10; + } + else if(hex[i]>='A' && hex[i]<='G'){ + val = (hex[i] - 'A')+10; + } + else{ + cout<<"error"; + } + cout< Date: Tue, 26 Oct 2021 07:09:22 +0530 Subject: [PATCH 2/2] Rename 17NumberSystemtoDecimal to 17NumberSystemtoDecimal.cpp --- 17NumberSystemtoDecimal => 17NumberSystemtoDecimal.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 17NumberSystemtoDecimal => 17NumberSystemtoDecimal.cpp (100%) diff --git a/17NumberSystemtoDecimal b/17NumberSystemtoDecimal.cpp similarity index 100% rename from 17NumberSystemtoDecimal rename to 17NumberSystemtoDecimal.cpp