新手,求助!

Atai-Lu Atai-Lu 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
#include<iostream>
#include<string>
using std::cout;
using std::cin;
using std::endl;
using std::string;
int main()
{
string text;
const string separators = ", . \" \n";
const int max_words=1000;
string words[max_words];
string* pwords[max_words];
cout<<endl<<"请输入一串字符,并按#键结束输入:"<<endl;
getline(cin, text, '#');/////////////这里有错误//////////
int start=text.find_first_not_of(separators);
int end = 0;
int word_count=0;
while(start!=string::npos&&word_count<max_words){
end=text.find_first_of(separators,start+1);
if(end==string::npos)
end=text.length();
words[word_count]=text.substr(start,end-start);
pwords[word_count] = &words[word_count];
word_count++;
}
int lowest=0;
for(int j=0;j<word_count-1;j++){
lowest=j;
int i=0;
for(j=j+i;i<word_count;i++)
if(*pwords[i]<*pwords[lowest])
lowest=i;
if(lowest!=j){
string* ptemp=pwords[j];
pwords[j]=pwords[lowest];
pwords[lowest]=ptemp;
}
}
for(int i=0;i<word_count;i++)
cout<<endl<<*pwords[i];
cout<<endl;
return 0;
}

====================================
F:\MyC\test2.cpp(15) : error C2065: 'getline' : undeclared identifier
====================================
谁能帮我看下这个程序的错误?谢谢了!
找了一下午也没找出来,闷...
...全文

相关推荐

求助大佬!coze新手手搓工作流运行错误无法搞定

求助大佬!coze新手手搓工作流运行错误无法搞定

student_tudou

PLSQL Developer与Instant Client 11.2配置与使用教程

PLSQL(Procedural Language/Structured Query Language)是Oracle数据库中用于编写存储过程、函数、触发器等数据库对象的编程语言。它是SQL语言的一个扩展,加入了过程化编程的特性,使得数据库操作更加灵活和强大。PLSQL使得开发者能够以结构化的方式处理业务逻辑,并在数据库层面直接进行优化,这不仅可以提高应用程序的性能,还能降低网络负载,因为它减少了客户端与服务器之间的通信次数。

凡狗蛋

新手求助RBF神经网络数据预测问题-数据.xls

新手求助RBF神经网络数据预测问题-数据.xls 本程序用前六个数据预测下一数据,前200组数据用于训练,用后80组数据进行预测,可预测结果为一个值,请大家指教: 源程序为: clc clear close all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %每五个数据整合, x=xlsread; n=length m=5; sum=0; j=1; x1=zeros); for k=1:m:n     for i=k:         sum=sum x;     end     x1=sum;     j=j 1;     sum=0; end j t=1:; figure plot;%,'d-m' hold on; grid on title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %归一化处理 [x2,mint,maxt] = premnmx figure plot;%,'d-m' hold on; grid on title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %输入数据 for k=1:1:200     p_train=[x2 x2 x2 x2 x2 x2]; 5*6     t_train=x2; 5*1 end     p_train=p_train'; %6*195     t_train=t_train'; %1*195 for z=1:1:81     p_test=[x2 x2 x2 x2 x2 x2];     t_test=x2; end      p_test=p_test';      t_test=t_test'; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %建立 RBF 网络                      goal = 0.0001;                     % 训练误差的平方和 spread = 0.01;                     % 此值越大,需要的神经元就越少 MN = size;              % 最大神经元数 DF = 1;                            % 显示间隔 net = newrb; data_out=sim p_mse=mse figure plot hold on plot title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %预测并作图 y=sim y_mse=mse figure plot; hold on; plot title; legend;

weixin_39841365

新手求助第二次输入数据怎么让switch函数重新确定-geshui.fig

新手求助第二次输入数据怎么让switch函数重新确定-geshui.fig 各位大神,我是新手,自学matlab,编写了一个计算个税缴纳的计算器GUI,来熟悉matlab的函数。 思路是输入应发工资、公积金抵税额、五险一金,输出交税额、实发工资。 其中,应发工资、公积金抵税额是edit直接输入,五险一金提供了两种方法,第一种是直接输入总额,第二种是输入缴费基数、缴费比例,计算得到。 这两种方式通过radio button二选一来选择,分别为选项一、选项二。设置一个计算button,现在遇到的问题有两个,如下: 1、运行GUI后,输入应发工资、公积金抵税额,五险一金总额,radio默认是五险一金总额计算方法,点击计算button,不能输出结果到edit。须点选项二radio button,再点击选项一radio button,计算才能输出结果。 2、第一次计算后,修改五险一金总额edit数值,点击计算button,输出结果不改变。但是修改公积金抵税额edit数值,点击计算button,可以正常计算。 请教大神,这两个问题如何解决?

weixin_39841856

新手求助RBF神经网络数据预测问题-历史开奖数据.xlsx

新手求助RBF神经网络数据预测问题-历史开奖数据.xlsx 本程序用前六个数据预测下一数据,前200组数据用于训练,用后80组数据进行预测,可预测结果为一个值,请大家指教: 源程序为: clc clear close all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %每五个数据整合, x=xlsread; n=length m=5; sum=0; j=1; x1=zeros); for k=1:m:n     for i=k:         sum=sum x;     end     x1=sum;     j=j 1;     sum=0; end j t=1:; figure plot;%,'d-m' hold on; grid on title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %归一化处理 [x2,mint,maxt] = premnmx figure plot;%,'d-m' hold on; grid on title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %输入数据 for k=1:1:200     p_train=[x2 x2 x2 x2 x2 x2]; 5*6     t_train=x2; 5*1 end     p_train=p_train'; %6*195     t_train=t_train'; %1*195 for z=1:1:81     p_test=[x2 x2 x2 x2 x2 x2];     t_test=x2; end      p_test=p_test';      t_test=t_test'; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %建立 RBF 网络                      goal = 0.0001;                     % 训练误差的平方和 spread = 0.01;                     % 此值越大,需要的神经元就越少 MN = size;              % 最大神经元数 DF = 1;                            % 显示间隔 net = newrb; data_out=sim p_mse=mse figure plot hold on plot title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %预测并作图 y=sim y_mse=mse figure plot; hold on; plot title; legend;

weixin_39841848
评论 5
收藏 已收藏
分享
返回顶部
Atai-Lu
C++ 语言 65,214 成员 250,514 内容