首页 > 试题广场 >

#include int main( ) {...

[填空题]
#include<stdio.h>
int main( ) {
    char str[20] = "Today - is - terrible!";
    int i;
    for (i = 6; i <= 10; i++)
        if (str[i] == ‘-‘) str[i – 1] = ‘x‘;
    for (i = 12; i >= 0; i--)
        if (str[i] == ‘t’) str[i + 1] = ‘e’;
    printf("%s\n", str);
    return 0;
}

输出:1

原字符串"Today - is - terrible!"错误,
应为“Today-is-terrible!”
发表于 2020-03-31 21:22:27 回复(10)