2 / 2
Aug 2017

include

using namespace std;

int main() {

std::ios::sync_with_stdio(false);
int t;
cin>>t;
int b[t],i,n,a[t][201],endp[t],u=0;
for(i=0;i<t;i++)
{		cin>>b[i];}
for(i=0;i<t;i++)
{		a[i][0]=1;}
int temp=0,x=0,k,j=0;
for(i=0;i<t;i++)
{
	n=b[i];
	for(;n>1;n--)
	{
		for(k=0;k<=j;k++)
		{
			x=(a[i][k]*n)+temp;
			a[i][k]=x%10;
			temp=x/10;
		}
		while(temp>0)
		{
			a[i][++j]=temp;
			temp=temp/10;
		}
	}
	endp[u]=j;
	u++;
	j=0;
}
cout<<"\n";
for(i=0;i<t;i++)
{
    j=endp[i];
    while(j>=0)
    {       cout<<a[i][j];j--;}
    cout<<"\n";
}
return 0;

}
indent preformatted text by 4 spaces

  • created

    Jul '17
  • last reply

    Aug '17
  • 1

    reply

  • 560

    views

  • 2

    users

1 month later

You need to define all elements such as b, c, i, n....

If you define them, I can give you further help

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 34 26d

Want to read more? Browse other topics in C and C++ or view latest topics.