Home Article Practice L2-DAY11

L2-DAY11

2023-02-03 18:43  views:696  source:徐老师Hosea    

#include<bits/stdc++.h>
using namespace std;
string s;
int main(){
int n, ans = 0;
cin >> n;
cin >> s;
int len = s.length();
for(int i = 0; i < len; i++){
ans += (s[i]-'0')*pow(n,len-i-1);
}
cout << ans;
return 0;
}



Disclaimer: The above articles are added by users themselves and are only for typing and communication purposes. They do not represent the views of this website, and this website does not assume any legal responsibility. This statement is hereby made! If there is any infringement of your rights, please contact us promptly to delete it.

字符:    改为:
去打字就可以设置个性皮肤啦!(O ^ ~ ^ O)