【发布时间】:2019-04-21 05:13:28
【问题描述】:
目前我已经弄清楚如何将每个元音变成'!',并且它确实有效。我为此使用了bool isVowel() 函数。
现在我想每隔三个字母大写一次。我的数组是char aPhrase[15] = "strongpassword":
while (aPhrase[i])
{
c=aPhrase[i];
putchar(toupper(c));
i+=3;
}
这只是让我SOPSRR 而不是Str!ngP!sSw!Rd。
【问题讨论】:
-
请出示minimal reproducible example,并具体说明您在代码中遇到的问题。
-
欢迎来到 stackoverflow.com。请花点时间阅读the help pages,尤其是名为"What topics can I ask about here?" 和"What types of questions should I avoid asking?" 的部分。也请take the tour 和read about how to ask good questions。最后请阅读this question checklist。
-
提示:不要三连跳。改为使用模运算符检查您是否在“每三分之一”上。