I have a problem where I need to work with variables
1 <= N <= 10^80
One of the test-cases works with a value:
3141592653589793238462643383279502884197169399375
and using unsigned long long int, the program sees this value maximum as:
18446744073709551615
Apparently, I need to store a value greater than that.
How do I solve this problem?
#include <iostream>
using namespace std;
int main()
{
unsigned long long int N;
cin >> N;
unsigned long long int Z;
int result = 0;
unsigned long long int num = N;
while (N > 0) {
Z += N % 10;
N /= 10;
}
while (Z % 9 != 0) {
Z += num;
result++;
}
cout << Z;
return 0;
}