#include stdiohint main char c32; getsc; for int i = 0; ci != 0; ++i ifci = a && ci = z ci += 32; printfcci; else printfcci;
该代码使用了不安全的函数gets,存在缓冲区溢出的风险。应该使用fgets函数来代替。另外,如果输入的字符是大写字母,则在转换为小写字母时应该减去32而不是加上32。
原文地址: https://www.cveoy.top/t/topic/b62l 著作权归作者所有。请勿转载和采集!