#include <stdio.h> #include<string.h> int main() { char arr[1000]=""; gets(arr); int len = strlen(arr); int flag = 0; int count = 0; for (int i = 0; i < len; i++) { if (flag == 0 && arr[i] == '"') flag = 1; else if (flag == 1 && arr[i] == '"') flag = 0; else if (flag == 0 && arr[i] == ' ') count++; } printf("%d\n", count + 1); for (int i = 0; i < len; i++) { if (flag == 0 && arr[i] == ' ') { printf("\n"); continue; } if (flag == 0 && arr[i] == '"') { flag = 1; continue; } if (flag == 1 && arr[i] == '"') { flag = 0; continue; } printf("%c", arr[i]); } return 0; }