http://acm.hdu.edu.cn/showproblem.php?pid=1984

字符串处理

View Code
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int t,n;
    char str[110];
    scanf("%d",&t);
    for(int cas=1;cas<=t;cas++)
    {
        scanf("%d %s",&n,str);
        str[n-1]='\0';
        printf("%d %s%s\n",cas,str,str+n);
    }
    return 0;
}

 

相关文章:

  • 2021-09-24
  • 2021-06-01
  • 2021-11-27
  • 2021-05-15
  • 2021-11-30
  • 2022-12-23
  • 2021-11-13
  • 2021-12-27
猜你喜欢
  • 2021-08-29
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-06-15
相关资源
相似解决方案