Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
20790 | 张熠欣 | 8进制转10进制 | C++ | Accepted | 100 | 0 MS | 256 KB | 208 | 2021-06-20 11:52:10 |
#include<bits/stdc++.h> using namespace std; string s; long long ans; long long q=1; int main(){ cin>>s; for(int i=s.size()-1;i>=0;i--){ ans+=(s[i]-'0')*q; q*=8; } cout<<ans; return 0; }