c++未知问题 超级次方问题

#define  _CRT_SECURE_NO_WARNINGS 
#include 
#include 
using namespace std;
int quickMod(int x, int n);
const int MOD = 10007;
class solution {
public:
    int x;
    vector<int> vc;
    solution(int x,vector<int>& vc) {
        this->x = x;
        this->vc = vc;
    }
};
int superPow(solution& s)
{
    int x = 1;
    for (vector<int>::iterator it = s.vc.end()--;it != s.vc.begin();it--)
    {
        x *= quickMod(s.x, *it)%MOD;
        s.x *= 10;
    }
    return x;
}
int quickMod(int x, int n) {
    if (n == 0)
    {
        return 1;
    }
    else if (n == 1)
    {
        return x;
    }
    else
    {
        int y = quickMod(x, n / 2) % MOD;
        return n % 2 == 0 ? y * y % MOD : y * y * x % MOD;
    }
}
void test(int x) {
    vector<int> vc;
    vc.push_back(1);
    vc.push_back(0);
    solution s(x, vc);
    cout << superPow(s) << endl;
}
void main() {
    int x;
    cin >> x;
    test(x);
    system("pause");
}

有这个问题

img


我就输入了个2

这个是vector爆掉了,再检查一下

void main() {

这一句改成

int main() {

试试看