题解 | 简写单词
简写单词
https://www.nowcoder.com/practice/0cfa856bf0d649b88f6260d878f35bb4
#include <stdio.h> #include<string.h> #include<stdlib.h> int main() { char str[101]; char ch; int i = 0 , j = 0; while((ch = getchar()) != EOF){ str[j++] = ch; while((ch = getchar()) != ' ' && ch != EOF); } for(int i = 0; i < j; i++){ if(str[i] >= 'a' && str[i] <= 'z') str[i] = str[i] - 32; printf("%c",str[i]); } return 0; }
复试练习1