Linux下的换行符问题

P1320 压缩技术(续集版)

@[自来也](/space/show?uid=87434) 这样不就好了吗?为什么要那样判? ```cpp #include<iostream> #include<cstdio> #include<string> using namespace std; int ans; string st,x; bool key=false,f=false; char q; int main() { while(cin>>x) { st.append(x); if(!f) { cout<<x.size()<<' '; f=true; } } int len=st.size(),i; for(i=0,q='0';i<=len;i++) if(st[i]==q) ans++; else { q=st[i]; cout<<ans<<' '; ans=1; } return 0; } ```
by Hexarhy @ 2019-01-28 16:21:08


@[HyyypRtf06](/space/show?uid=80049) 同志你走错场了,他问为什么没问怎么写。
by tоurist @ 2019-01-28 16:26:20


|