fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main(void) {
  6. int testCase;
  7. scanf("%d", &testCase);
  8. for (int i = 0; i < testCase; i++) {
  9. int rePlay;
  10. char str[21];
  11. scanf("%d %s", &rePlay, &str);
  12. char P[161];
  13. for (int j = 0; j < strlen(str); j++) {
  14. for (int k = rePlay * j; k < rePlay * strlen(str); k++) {
  15. if (k / rePlay == j) P[k] = str[j];
  16. else break;
  17. }
  18. }
  19. for (int j = 0; j < rePlay * strlen(str); j++) {
  20. printf("%c", P[j]);
  21. }
  22. printf("\n");
  23. }
  24. system("pause");
  25. return 0;
  26. }
Success #stdin #stdout #stderr 0s 15232KB
stdin
3
2 qwe
4 qer
1 q
stdout
qqwwee
qqqqeeeerrrr
q
stderr
sh: 1: pause: not found