Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- /*long long mypow(long long b){
- long long c=1;
- for(int i=1;i<=b;i++){
- c=c*7;
- }
- return c;
- }*/
- int main(){
- char a[8]={'#','%','$','&',92,'~','!','@'};
- long long c[8]={0,1,2,3,4,5,6,-1};
- string s;
- while(cin>>s&&s!="0"){
- long long ans=0;
- for(int i=0;i<s.length();i++){
- for(int j=0;j<8;j++){
- if(s[i]==a[j]){
- ans+=(c[j]*pow(7,s.length()-i-1));
- }
- }
- }cout<<ans<<'\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement