8.24中兴笔试
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <string> using namespace std; int main() { int T; cin >> T; vector<string>str; string s; long l, r; vector<int>res; for (int i = 0; i < T; ++i) { cin >> s; str.push_back(s); cin >> l >> r; long sum = 0; for (int j = l; j <= r; ++j) { long num = 0; for (int k = 0; k < str[i].size(); ++k) { if (str[i][k] <= '9'&&str[i][k] >= '0')num = num * j + str[i][k] - '0'; else num = num * j + str[i][k] - 'A' + 10; } sum += num; } res.push_back(sum % 2); } for (int i = 0; i < res.size(); ++i) { cout << res[i] << endl; } return 0; }这个第二题写的有毛病吗? 晕了? 咋回事啊,通过0%? 各种int long longlong 等不沾边的小修改,完全没用,实在不知道问题在那呀~有没有大佬解答下
#中兴##笔试题目#