2013年长春区域赛

来源:互联网 发布:阿里云解析域名教程 编辑:程序博客网 时间:2024/06/04 18:24

A题   (字符串处理的水题)

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

#include<iostream>#include<cstdio>#include<cstring>#include<cmath>using namespace std;const int maxn=1000+10;char s[maxn],a[maxn][maxn];int main(){    int t;    cin>>t;    while(t--)    {        int n,m;        cin>>n>>m;        cin>>s;        for(int i=0;i<n;i++)        {            for(int j=0;j<m;j++)                a[i][j]=s[i*m+j];        }            for(int i=0;i<n;i++)            {                for(int j=0;j<m;j++)                    printf("%c",a[i][j]);                printf("\n");            }    }    return 0;}



0 0
原创粉丝点击