标题:新手~关于单词用什么来表示?
取消只看楼主
lockhawk
Rank: 1
等 级:新手上路
帖 子:94
专家分:0
注 册:2008-9-17
 问题点数:0 回复次数:1 
新手~关于单词用什么来表示?
我知道字母用 char。下面这个程序我想换成单词,把char改成什么才行
#include "iostream.h"
#include "iomanip.h"
void dao(char a[],int size);
int main()
{
    char danci[5];
    for(int i=0;i<5;i++)
       {
       cout<<"请输入单词:";
       cin>>danci[i];
       cout<<endl;
       }
    const int size=5;
    dao(danci,size);
return 0;
}
void dao(char a[],int size)
{
    
    cout<<"重新排列的单词:";
    for(int k=0;k<size;k++)
    {
        cout<<a[size-1-k]<<" ";
    }
}
搜索更多相关主题的帖子: 单词 
2008-09-25 15:17
lockhawk
Rank: 1
等 级:新手上路
帖 子:94
专家分:0
注 册:2008-9-17
得分:0 
我这样子改,有N个编译错误啊


#include "iostream.h"
#include "iomanip.h"

void dao(string a[],int size);
int main()
{
    string danci[count];
    for(int i=0;i<5;i++)
       {
       cout<<"请输入单词:";
       cin>>danci[i];
       cout<<endl;
       }
    const int size=5;
    dao(danci);
return 0;
}
void dao(string a[],int size)
{
    
    cout<<"重新排列的单词:";
    for(int k=0;k<size;k++)
    {
        cout<<a[size-1-k]<<" ";
    }
}
2008-09-25 15:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-235130-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.085969 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved