0
What printf does?
here's code: #include <stdio.h> int main() { long long i, n = 600851475143; for (i = 3; n > 1; i += 2) while (n % i == 0) n /= i; printf("%lld\n", i - 2); return 0; } What is in printf and what it means?
5 Réponses
0
%lld is used to print long long integer.
0
when i change it to std::cout << n; it outputs 1, and why in printf is i - 2 ?
0
Run the while loop like this, it will make more sense.
while (n % i == 0) {
n /= i;
printf("%lld is divided by %lld\n", n,i);
}
0
printf function prints the text on console..it is used in c language