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

水题。

View Code
 1 #include <stdio.h>
 2 #include <stdlib.h>
 3 #include<string.h>
 4 
 5 int main()
 6 {
 7     int n,i,len;
 8     char str[210];
 9     while(~scanf("%d",&n),n)
10     {
11           //getchar();
12           scanf("%s",str);
13           len=strlen(str);
14           for(i=0;i<n;i++)
15           {
16                 int temp=i;
17                 while(temp<len)
18                 {
19                       putchar(str[temp]);
20                       if(temp+2*n-1-i*2<len)
21                       putchar(str[temp+2*n-1-i*2]);
22                      //printf("%c%c",str[temp],str[temp+2*n-1-i*2]);
23                      temp=temp+2*n;;
24                 }
25           }
26           printf("\n");
27     }
28 }

 

相关文章:

  • 2021-09-23
  • 2021-11-28
  • 2022-12-23
  • 2021-12-02
  • 2021-07-08
  • 2021-06-06
  • 2021-10-13
  • 2022-12-23
猜你喜欢
  • 2021-11-14
  • 2022-12-23
  • 2021-10-07
  • 2021-08-06
  • 2021-06-03
  • 2021-05-24
  • 2022-12-23
相关资源
相似解决方案