|
|
вернуться в форум(C)what's error 7!! #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!! #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; } |
|
|