こんにちは皆さん、私はC ++の初心者なので、プログラムを書いていて問題なく動作しますが、問題があります。100 より大きい数値を入力するたびにプログラムがクラッシュし、その理由がわかりません。誰でも私を助けることができますか?
プログラムコード:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int i = 10;
while(i > 0)
{
i--;
int b = 0, c = 1, d = 0, e, number, how = 0, number1, start, to, number2, split1, split2, mass, start1 = 0, start2 = 0, number3, how1, number4, number5;
cout << "\nIveskite skaiciu \n";
cin >> number;
cout << "\n";
number1 = number;
while(number1 > 0)
{
number1 = number1 / 10;
how = how + 1;
}
how1 = how - 1;
start = pow(10, (how - 1));
to = pow(10, how);
mass = to - start;
number2 = start - 1;
int split[mass][mass], numbers[mass], ok[mass];
while(start1 < mass)
{
start1++;
e = number2 + start1;
numbers[start1] = e;
split[start1][0] = e;
}
while(start2 < mass)
{
start2++;
number3 = numbers[start2];
d = 0;
b = 0;
c = 1;
while(d <= how1)
{
d++;
split1 = number3%10;
split2 = number3 / 10;
number3 = split2;
split[start2][d] = split1;
number4 = b + split[start2][d];
b = number4;
number5 = c * split[start2][d];;
c = number5;
}
if(number4 == number5)
{
ok[mass] = numbers[start2];
cout << number4 << " " << number5 << " >" << ok[mass] << endl;
}
}
}