|
|
back to boardWA1(help) why WA1????? please, help. #include<iostream> #include <stdio.h> #include<string> using namespace std; string s; int main() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif
cin>>s; int i=0;
while (s[i]!=0) { if(s[i]==s[i+1]) { s.erase(i,2); i--; } else i++; } cout<<s; return 0; } Re: WA1(help) Posted by hatred 10 Aug 2011 04:44 If I understand your code right, you think there is only one number in line. It is not right |
|
|