Mexican Wave(C语言CodeWars)

解题思路:

(1)注意空格是不被考虑的

#include <ctype.h>
void wave(const char *y, char **target) {
    int count=0,counts=0;
    const char *p = y;
    while(*y!='\0') {
	if(!isspace(*y)) {
	    strcpy(target[count],p);
	    target[count][counts]=toupper(*y);
	    count++;
	}
	counts++,y++;
    }
}
发布了317 篇原创文章 · 获赞 279 · 访问量 43万+

猜你喜欢

转载自blog.csdn.net/coolsunxu/article/details/105715281
今日推荐