Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
21316 | 高琦炜 | 8进制转10进制 | C++ | Accepted | 100 | 0 MS | 260 KB | 202 | 2021-06-27 11:48:28 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int ans=0,a,w=1; for(int i=s.size()-1;i>=0;i--){ a=s[i]-'0'; ans+=w*a; w*=8; } cout<<ans; return 0; }