<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个或多个空格间隔,请对应地计算各个单词的长度。
输入一个整数和双精度浮点数,先将浮点数保留2位小数输出,然后输出整数。
一个正整数,如果它能被7整除,或者它的十进制表示法中某一位上的数字为7,则称其为与7相关的数.现求所有小于等于n(n < 100)的与7无关的正整数的平方和
本题目要求读入一个正整数n(n<10),然后输出n层的数字金字塔。
若将一个正整数化为二进制数,在此二进制数中,我们将数字1的个数多于数字0的个数的这类二进制数称为好数。
_________________________