oj是什么缩写_C++英文缩写单词,写好了,OJ上过不了,求帮助

int main()

{

string line,word;

vector st;

vector::iterator it;

int size,i;

int tl;

string tmp,tmp1,tmp2;

while(getline(cin,line))

{

st.clear();

istringstream stream(line);

while(stream>>word)

{

if(word!="a"&&word!="an"&&word!="the"&&word!="of"&&word!="and"&&word!="for"&&word!="A"&&word!="An"&&word!="The"&&word!="Of"&&word!="And"&&word!="For"&&word!="AN"&&word!="THE"&&word!="OF"&&word!="AND"&&word!="FOR")

{

size=word.size();

i=0,tl=0;

int ltl=0;

while(1)

{

if(i>=size)break;

for(;i

{

if(word[i]=='-')

break;

}

tmp1=word.substr(ltl,tl-ltl);

if(tmp1!="a"&&tmp1!="an"&&tmp1!="the"&&tmp1!="of"&&tmp1!="and"&&tmp1!="for"

&&tmp1!="A"&&tmp1!="An"&&tmp1!="The"&&tmp1!="Of"&&tmp1!="And"&&tmp1!="For"

&&tmp1!="AN"&&tmp1!="THE"&&tmp1!="OF"&&tmp1!="AND"&&tmp1!="FOR")

{

tmp=word[ltl];

st.push_back(tmp);

}

ltl =tl+1;

i++;

tl++;

}

// if(i==size)

// {

// tmp=word[0];

// st.push_back(tmp);

// }

// else

// {

// tmp1=word.substr(0,tl);

// tmp=tmp1[0];

// st.push_back(tmp);

// tmp2=word.substr(tl+1,size-tl);

// tmp=tmp2[0];

// st.push_back(tmp);

// }

}

}

for(it=st.begin();it!=st.end();it++)

{

cout<

}

cout<

}

return0;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值