首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

单词倒转程序的小疑点

2013-12-28 
单词倒转程序的小问题#include stdio.hstruct string{char word[100]}int main(void){int n10,n20,n

单词倒转程序的小问题
#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上发帖大家帮帮我吧~~谢谢大神
[解决办法]

 

热点排行