<br><p>输入一个句子(一行),将翻转句子中单词顺序后输出。</p><p>输入:I am a student. 输出:student a am I.</p>
输入一个句子(一行),将翻转句子中单词顺序后输出。
输入:I am a student. 输出:student a am I.
输入一个句子(一行),将翻转句子中单词顺序后输出。
输入:I am a student. 输出:student a am I.
#include < stdio.h >
#include < string.h >
void reverse(char * str, int start, int end) {
end--;
while (end > start) {
char tem = strstart];
strstart] = strend];
strend] = tem;
start++;
end--;
}
}
void reverseword(char * str) {
int start = 0, end = 0;
while (strstart] != \'\\0\') {
while (strend] != \'\\0\'&&strend]!=\' \') {
end++;
}
reverse(str, start, end);
if (strend] != \'\\0\') {
start = end + 1;
} else {
start = end;
}
end++;
}
}
int main() {
char c20];
int start = 0, end = 0;
gets(c);
int n;
n = strlen(c);
reverse(c, 0, n);
reverseword(c);
puts(c);
return 0;
}
输入一个句子(一行),将翻转句子中单词顺序后输出。
输入:I am a student. 输出:student a am I.
输入一行单词序列,相邻单词之间由1个或多个空格间隔,请对应地计算各个单词的长度。
一个正整数,如果它能被7整除,或者它的十进制表示法中某一位上的数字为7,则称其为与7相关的数.现求所有小于等于n(n < 100)的与7无关的正整数的平方和
_________________________
现在给出n行m列的雷区中的地雷分布,要求计算出每个非地雷格的周围格地雷数。
注:每个格子周围格有八个:上、下、左、右、左上、右上、左下、右下。
输入格式
输入包括两行数据。
下面是关于某班学生申请助学补助的描述:
所有同学都申请了;
所有同学都没有申请了;
小王申请了。