ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1083. Factorials!!!

(C)what's error 7!!
Posted by alireza 29 Jun 2012 18:24
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
  int a,k=-1,fact=1,term=1,i=0;
  char c;
  scanf("%d",&a);
  getchar();
  do{
     c=getchar();
     k++;
     }
  while(c==33);
  if(k>a) fact=-1;
  while(fact>0){
                term*=fact;
                fact=(a-i*k);
                i++;
                }



  if(k<=a) printf("%d",term);
  system("PAUSE");
  return 0;
}


Edited by author 01.07.2012 19:03
Re: (C)what's error 7!!
Posted by Shahriar Shaon 26 Dec 2017 02:56
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
  int a,k=-1,fact=1,term=1,i=0;
  char c;
  scanf("%d",&a);
  getchar();
  do{
     c=getchar();
     k++;
     }
  while(c==33);
  if(k>a) fact=-1;
  while(fact>0){
                term*=fact;
                fact=(a-i*k);
                i++;
                }



  if(k<=a) printf("%d",term);
  system("PAUSE");
  return 0;
}