Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdio>
- int main(){
- int x, i = 0;
- scanf("%d", &x);
- while(getchar() == '!'){
- i++;
- }
- long fact = 1;
- for(int b = x; (b >= x % i) && (b > 0); b -= i){
- fact *= b;
- }
- printf("%ld", fact);
- }
Advertisement
Add Comment
Please, Sign In to add comment