We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e325ea2 commit 911d0e3Copy full SHA for 911d0e3
Codeshef/FCTRL2.cpp
@@ -0,0 +1,35 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+int main(){
5
+ int T;
6
+ cin>>T;
7
+ while(T--){
8
+ int n;
9
+ cin>>n;
10
11
+ int a[200],carry=0,temp,m=0;
12
13
+ for(int i=0;i<200;i++)a[i]=0;
14
15
+ a[0]=1;
16
17
+ for(int i=2;i<=n;i++){
18
19
+ for(int j=0;j<=m;j++){
20
+ temp = (i*a[j])+carry;
21
+ carry = temp/10;
22
+ a[j]=temp%10;
23
+ if(carry!=0 && j==m){
24
+ m++;
25
+ }
26
27
28
29
+ for(int i=m;i>=0;i--)cout<<a[i];
30
+ cout<<endl;
31
32
33
34
+ return 0;
35
+}
0 commit comments