您的位置:首页 > 其它

HDU 4813 Hard Code(水题,2013年长春现场赛A题)

2014-01-05 23:31 435 查看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4813

签到题。

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

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <math.h>
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int T,n,m,p;
char str[11111];
scanf("%d",&T);
while(T--){
scanf("%d %d",&n,&m);
scanf("%s",str);
p = 0;
for(int i = 0;i < n; i ++)
{
for(int j = 0; j <  m; j ++)
cout<<str[p++];
cout << endl;
}
}

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: