CPP   32
quantidade
Guest on 8th September 2023 02:37:13 PM


  1. #include <iostream>
  2. #include <string>
  3. #include <cstring>
  4. #include <string.h>
  5. #include <cstdio>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <cstdlib>
  9. #include <algorithm>
  10. #include <math.h>
  11.  
  12. using namespace std;
  13.  
  14. int main(){
  15.         freopen("in.txt", "r", stdin);
  16.         int quantidade, sinal, num, i;
  17.         long long resp;
  18.         string linha;
  19.         scanf("%d", &quantidade);
  20.         //while(quantidade){
  21.                 while(quantidade--){
  22.                         resp = 1;
  23.                         scanf("%d", &num);
  24.                         cin >> linha;
  25.                         sinal = linha.size();
  26.                         for(i = 0; i < num;){
  27.                                 resp *= num;
  28.                                 num -= sinal;
  29.                         }
  30.                         printf("%lld\n", resp);
  31.                 }
  32.         //      scanf("%d", &quantidade);
  33. //      }
  34.        
  35.        
  36.         return 0;
  37. }

Raw Paste

Login or Register to edit or fork this paste. It's free.