Reputation: 1
hope everyone is good. I'm a student and I'm having a really bad time with a homework. My teacher asked me to create a program to print every divisor of a number in crescent order in less than 10 seconds using the dart language. The problem is: He wants the divisor to be a number of about 14 characters, more precisely the number: 21,001,713,200,000. I'm having overflow issues because this is a large number. I really appreciate if someone could help me.
`
void main(){
int a = 40;
int aux = 0;
for (int i = 2; i < a; i++) {
if (a % i == 0) {
++aux;
}
}
List<int> diva = [];
int k = 0;
aux = 1;
for (int i = 0; i < a; i++) {
++aux;
if (a % aux == 0) {
diva.insert(k++, aux);
}
}
print('${diva}');
}
`
Upvotes: 0
Views: 120