Once you get your program to compile with a C++ compiler, put it on http://ideone.com (which happens to be an online compiler that allows arbitrary input) and give it the input similar to what your contest gives you.
For example, run it with
7
5
10
1
2
75
99
100
in the input field, and if you wrote it correctly, it should show
This is where you have to be aware of the limits of your data types - you need a different method because with the standard types you are not going to get anywhere near factorial 100. Even a 64 bit unsigned int only gives 20 significant figures.
A different method could be to store numbers as bits, then do multiplication by bit shifting. Shifting left by 1 is the same as multiplying by 2. So do code to factor your multiplying number into 2's.
Example: 50 * 33
= 50 * 2 * 2 * 2 * 2 * 2 + 50
= (50 << 5) + 50
You can use the log function to see how factors of 2 there are in a number, rounding down.
Any way I am just writing this off the cuff, so I had better leave you in the expert hands of cubbi - as I haven't actually done it. (Maybe I should try it myself !!)
Sorry I didn't mention this earlier - I was focussing on getting your code to compile & didn't ask what the actual question was.
ok, you lost me there..........i have no clue whatsoever about bit shifting multiplication (Remember, i'm a student who started programming about 7 months ago)
As I said unsigned long long (a 64 bit number) will only give 20 significant places - as cubbi's post shows you need a lot more than that.
long double will hold a big enough number, but will only give you 18 significant places, so you need another method. As I said these online judge things aren't that easy.
ok, you lost me there..........i have no clue whatsoever about bit shifting multiplication (Remember, i'm a student who started programming about 7 months ago)
Did you see the link I posted? I added it afterwards. It explains what bit shifting means, & I gave a quick example.
You can google to get more examples - hell there is probably the answer to the question somewhere.
Any way I am going to bed - it's 04:45AM here. Have a go at the new method, then cubbi or someone else may help you.
..oh, right, LWS allows input too now.
Calculating factorials up to 100 is not a one-liner program in C++, that's what makes it a competition, I guess (in practice, it's trivial with boost-1.53 or with other multiprecision libraries)
Or you could just hardcode all 100 possible answers as an array of strings.