实验11-1-9 藏尾诗

 1 #include <stdio.h>
 2 #include <string.h>
 3 int main(void)
 4 {
 5     char s[4][19];
 6     int len;
 7     
 8     for (int i = 0; i < 4; i++)
 9     {
10         scanf("%s", s[i]);
11     }
12     
13     char s1[9];
14     int k = 0;
15     for (int i = 0; i < 4; i++)
16     {
17         len = strlen(s[i]);
18         for (int j = len - 2; j < len; j++)
19         {
20             s1[k] = s[i][j];
21             k++;
22         }
23     }
24     
25     s1[k] = '\0';
26     printf("%s", s1);
27      
28     return 0;
29 }

 

posted @ 2020-07-13 20:17  jason2018  阅读(6)  评论(0编辑  收藏