Advertisement
DaniDori

Untitled

Mar 19th, 2023
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include<string>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string s, s1;
  9. int n=0, c=1;
  10. cin >> s >> s1;
  11. //cout << s.length() << s1.length();
  12. int size = stoi(s), len = s1.length();
  13.  
  14. if (size % len == 0) {
  15. while (len != n) {
  16. n++;
  17. c = c * (size - n * len);
  18.  
  19. }
  20. c = c * size * len;
  21. cout << endl << c;
  22. }
  23. if (size % len != 0) {
  24. while (size > n*len) {
  25.  
  26. n++;
  27. c = c * (size - n * len);
  28.  
  29.  
  30. }
  31. c = c * (size % len) * size;
  32. cout << endl << c;
  33. }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement