题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4813

 

签到题。

把一个字符串按照格式输出就可以了,很水

 

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <iostream>
 4 #include <algorithm>
 5 #include <queue>
 6 #include <map>
 7 #include <set>
 8 #include <vector>
 9 #include <string>
10 #include <math.h>
11 using namespace std;
12 int main()
13 {
14     //freopen("in.txt","r",stdin);
15     //freopen("out.txt","w",stdout);
16     int T,n,m,p;
17     char str[11111];
18     scanf("%d",&T);
19     while(T--){
20         scanf("%d %d",&n,&m);
21         scanf("%s",str);
22         p = 0;
23         for(int i = 0;i < n; i ++)
24         {
25                 for(int j = 0; j <  m; j ++)
26                     cout<<str[p++];
27             cout << endl;
28         }    
29     }
30 
31     return 0;
32 }

 

相关文章:

  • 2021-08-21
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2021-08-18
  • 2022-01-07
  • 2021-12-18
猜你喜欢
  • 2021-06-08
  • 2021-09-12
  • 2021-11-02
  • 2021-07-04
  • 2022-12-23
  • 2021-06-21
  • 2022-02-05
相关资源
相似解决方案