1000 digits

I'm currently doing this problem:
http://coj.uci.cu/24h/problem.xhtml?pid=1102
which is actually a very easy problem, just that I have a slight problem, how do I store 1000 digit integers? Here is my current code, although the online judge keeps saying wrong answer because my code can't store 1000 digit integers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#include <iostream>
using namespace std;

int main() {
    unsigned long x, r;
    for (;;) {
        scanf("%lu", &x);
        r=x%11;
        if (x==0) {
            break;
        }
        if (r==0){
            printf("%lu", x); printf("%s\n", " is a multiple of 11.");
        }
        else{
            printf("%lu", x); printf("%s\n", " is not a multiple of 11.");
        }
    }
}

Either use a bignum library if you can find no other way of doing it (seems like a bad idea) or store the characters in a string and use a more advanced algorithm to determine if it is a multiple of eleven.
How would I do any of those 2 options? I'm fairly new to coding.
https://www.math.hmc.edu/funfacts/ffiles/10013.5.shtml
Just read number in a string, then iterate over string applying divisibility by 11 algorithm.
And how do I do that? I'm sorry for being so stubborn, I just really don't know how to do this.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <string>

int main()
{
    std::string number;
    std::cin >> number;
    int result = 0;
    for(int i = 0; i < number.size(); ++i) {
        int digit = number[i] - '0';
        //Do calculations with current digit
    }
    //Use result to determine if it is divisible by 11;
}
Thanks!!
Topic archived. No new replies allowed.