usaco fact

USER: yin guangxue [yinguan1]
TASK: fact4
LANG: C++

Compiling...
Compile: OK

Executing...
   Test 1: TEST OK [0.000 secs, 2928 KB]
   Test 2: TEST OK [0.000 secs, 2928 KB]
   Test 3: TEST OK [0.022 secs, 2928 KB]
   Test 4: TEST OK [0.000 secs, 2928 KB]
   Test 5: TEST OK [0.000 secs, 2928 KB]
   Test 6: TEST OK [0.011 secs, 2928 KB]
   Test 7: TEST OK [0.000 secs, 2928 KB]
   Test 8: TEST OK [0.000 secs, 2928 KB]
   Test 9: TEST OK [0.011 secs, 2928 KB]
   Test 10: TEST OK [0.011 secs, 2928 KB]

All tests OK.

Your program ('fact4') produced all correct answers!  This is your
submission #5 for this problem.  Congratulations!
/* ID: yinguan1 PROG: fact4 LANG: C++ */ #include <fstream> using namespace std; ifstream fin("fact4.in"); ofstream fout("fact4.out"); int main() { int N; fin>>N; int result=1; for(int i=1; i<N+1; ++i) { if(result>(1<<15)) { while(!(result%10)) result/=10; result%=10; } result*=i; } while(!(result%10)) result/=10; fout<<result%10<<endl; return 0; }

一开始1《《10有错误,不知道为啥。

你可能感兴趣的:(c,user)