A - Hard Code Hdu 4813

题目大意:给你一坨字符串,让你输出其栅栏密码的解码形式

思路:水题模拟

 

 1 #include<iostream>
 2 #include<cstdio>
 3 #include <math.h>
 4 #include<algorithm>
 5 #include<string.h>
 6 #include<queue>
 7 #define MOD 1000003
 8 #define maxn 2009
 9 using namespace std;
10 char ch[maxn];
11 int main()
12 {
13         int n,m,t;
14         scanf("%d",&t);
15         while(t--)
16         {
17                 scanf("%d%d",&n,&m);
18                 scanf("%s",ch+1);
19                 int now=0;
20                 for(int i=1;i<=n;i++)
21                 {
22                         for(int j=1;j<=m;j++)
23                         {
24                                 printf("%c",ch[++now]);
25                         }
26                         printf("\n");
27                 }
28         }
29         return 0;
30 }
View Code

相关文章:

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