|
|
back to boardPlease test my code, because I think it's ok Please try my program for different input data, I don't know where I am wrong. Maybe I missunderstood problem, everyone use array, I don't think it's necessary ?! #include <iostream.h> #include <math.h> int main() { int niz[10]; int brojac = 1; int rezultat; int p = 1; int koren; for (int i = 0; i < 10; i++) cin >> niz[i]; for (int j = 0; j < 10; j++) p = p * niz[j]; if (p == 1) { cout <<1; return 0; } koren = floor(sqrt((double)p)); for (int k = 2; k <=koren; k++) { if (p % k == 0) { if (p/k == k) brojac++; else brojac = brojac + 2; } } brojac++; rezultat = brojac % 10; cout << rezultat; return 0; } Re: Please test my code, because I think it's ok What your answer for test: 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 For this test p=10^40. |
|
|