题解 | #简写单词#
简写单词
https://www.nowcoder.com/practice/0cfa856bf0d649b88f6260d878f35bb4
#include <stdio.h> int main() { char arr[100000] = {0}; gets(arr); int i = 0; while (arr[i] != '\0') { if (i == 0) { if (arr[i] >= 'a' && arr[i] <= 'z') { printf("%c",arr[i] -32); } else { printf("%c",arr[i]); } } if (arr[i-1] == ' ') { if (arr[i] >= 'a' && arr[i] <= 'z') { printf("%c",arr[i] -32); } else { printf("%c",arr[i]); } } i++; } return 0; }