题解 | 多组_带空格的字符串_T组形式
多组_带空格的字符串_T组形式
https://www.nowcoder.com/practice/cff28a28d7f54419a640a8bb19f4275f
#include <stdio.h> int main() { int t, x = 0; scanf("%d\n", &t); for (int i = 0; i < t; i++) { x=0; int n = 0; scanf("%d\n", &n); char s; char arr[n]; for (int j = 0; j < n; j++) { scanf("%c", &s); if (s == ' ') continue; arr[x] = s; x++; } for (int k = x - 1; k >= 0; k--) { printf("%c", arr[k]); } printf("\n"); } return 0; }