题解 | #skew数#
skew数
https://www.nowcoder.com/practice/5928127cc6604129923346e955e75984
pow头文件为#include<cmath>
#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int main() {
string str = "";
while (getline(cin, str)) {
int res = 0;
int len = str.size();
for (int i = len - 1, k = 0; i >= 0; i--, k++) {
res += (str[i] - '0') * (pow(2, k + 1) - 1);
}
cout << res << endl;
}
return 0;
}
王道考研机试 文章被收录于专栏
包含考研机试打卡表题目
查看4道真题和解析
