Skip to main content
1 of 4
xsot
  • 5.6k
  • 1
  • 17
  • 24

C, (126 - 3) bytes

i,j,a;main(b,s){for(sscanf(gets(s),"%d %d",&a,&b);j<a+b;i=++i<a+b?i:puts("")>++j)printf("%*d",strlen(s),(i<a?a:b)*(j<b?b:a));} 

Each cell is padded with spaces to the length of the input string.

xsot
  • 5.6k
  • 1
  • 17
  • 24