ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1654. Cipher Message

WA1(help)
Posted by Jango_Fet 9 Aug 2011 18:23
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