Saturday, January 3, 2015

Solution of 1083. Factorials!!! ( Timus Online Judge )

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define pf printf
#define sf scanf
typedef long long ll;

int main()
{
    int n, len, i;
    ll ans=1;
    string s;
    cin >> n;
    cin >> s;
    len = s.length();
    for(i=n ; i>0 ; i =(i-len))
    {
        ans = (ans*i);
    }
    cout << ans << endl;
}


No comments:

Post a Comment

Compare equality of two string in C

#include <stdio.h> #include<string.h> int main() {     char* country = "Bangladesh";     char* country2;     ...