Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7212 - Факториалын хүрд

Өгөгдсөн тоо хүртэлх натурал тоонуудын факториалыг жишээн дээрх форматаар хэвлэ.

Input

Натурал тоо өгөгдөнө.

Output

Өгөгдсөн тоо хүртэлх натурал тоонуудын факториалыг нэг нэг мөрөнд жишээн дээрхтэй ижлээр хэвлэнэ. 

Example

Input:
4

Output:
1!=1
2!=2
3!=6
4!=24

Нэмсэн:Bataa
Огноо:2013-01-21
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2024-11-24 18:17:29
#include <iostream>
using namespace std;
int main() {
int n,i,b=1,j;
cin>>n;
for(j=1; j<=n; j++) {
b=b*j;
cout<<j<<"!="<<b<<endl;
}
}
FUUUUUUUUUUUUUUUUUUU
2024-11-22 03:31:01
#include<stdio.h>
int main(){
int i,n,a[100],x,s=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&a[i]);
}
scanf("%d",&x);
i=1;
while(s==0 && i<=n){ if(a[i]==x) s++;
else i++;
}
if(s==1) printf("YES");
else printf("NO");
return 0;
}
2024-11-10 07:46:00
hohohoohooho
shine jilc bollo shu tei guys
2024-03-03 06:27:10
#include <iostream>
using namespace std;
int main()
{
long long n,i,b,s;
cin>>n;
long long a[n];
s = 1;
for(i=1;i<=n;i++)
{
s = s*i;
}
a[n] = s;
for(i=n-1;i>=1;i--)
{
a[i]=a[i+1]/(i+1);
}
for(i=1;i<=n;i++)
{
cout<<i<<"!="<<a[i]<<"\n";
}
}
what is up my duudes

Last edit: 2024-03-03 06:27:43
2024-02-22 09:16:18
#include<bits/stdc++.h>
using namespace std;

int fact(int x){
if(x==1){
return 1;
}
else{
return x*fact(x-1);
}
}

main(){
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++){
printf("%d!=%d\n", i, fact(i));
}
} using recursion function
2024-02-19 07:31:27
#include<bits/stdc++.h>
using namespace std;
int main(){
long i, n, s=1;
cin>>n;
for(i=1; i<=n; i++){
s=s*i;
cout<<i<<"!"<<"="<<s<<endl;
}
}
2024-02-19 07:31:25
#include<bits/stdc++.h>
using namespace std;
int main(){
long i, n, s=1;
cin>>n;
for(i=1; i<=n; i++){
s=s*i;
cout<<i<<"!"<<"="<<s<<endl;
}
}
2024-02-19 07:30:23
#include<bits/stdc++.h>
using namespace std;
int main(){
long i, n, s=1;
cin>>n;
for(i=1; i<=n; i++){
s=s*i;
cout<<i<<"!"<<"="<<s<<endl;
}
}

2024-01-24 14:48:50
#include<iostream>
using namespace std;
int main()
{int a,b,s=1,k;
cin>>a;
for(b=1;b<=a;b++){ s=s*b; cout<<b<<"!"<<"="<<s<<endl;
}}
// copy if you gay from : schneizel//
2024-01-02 10:14:10
import java.util.Scanner;

public class Think {
public static void main(String[] args) throws java.lang.Exception {
Scanner in = new Scanner(System.in);
int a = in.nextInt();
int result = 1;
int i = 1;
while (i <= a) {
result = result * i;
System.out.println(i + "!" + "=" + result);
i++;
}

}
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.