单词倒转程序的小问题
#include <stdio.h>
struct string
{
char word[100];
};
int main(void)
{
int n1=0,n2=0,n3=0;
struct string sa[100];
while (sa[n1].word[n2]=getchar()!='\n')
{
n3=n2;
n2++;
if (sa[n1].word[n3]==' ')
{
n1++;
n2=0;
while (getchar()!='\n');
}
}
while (n1>=0)
{
puts(sa[n1].word);
n1--;
}
}
一个句子单词倒转的题目
我的代码是上面那样的,我是想输入到二维数组中然后倒转输出,,,刚学的数据结构想要用一下试下
然后- -为啥输出是一个笑脸.......
= =第一次CSDN上发帖大家帮帮我吧~~谢谢大神
[解决办法]