题解 | #表示数字#
表示数字
https://www.nowcoder.com/practice/637062df51674de8ba464e792d1a0ac6
#include <ctype.h> #include <stdio.h> #include <string.h> int main() { char input[110] = {0}; gets(input); int len = strlen(input); for(int i = 0; i < len; ++i) { if(isdigit(input[i])) { putchar('*'); putchar(input[i]); for(++ i; i < len && isdigit(input[i]); ++ i) { putchar(input[i]); } putchar('*'); if(i < len) { putchar(input[i]); } } else { putchar(input[i]); } } return 0; }