20digits integer input

How to take 20 digits integer as input in c/c++?

Use unsigned long long int or a string.

Usually in questions like that which involves numbers with lots of digits, you either take them as string or use multiprecision library.

Actually i am solving this question. FACT1

Unsigned long long will work.

I suggest you to take the input as string as performing operations on such a large number will always give TLE