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 1098. Questions

I have wa#5 andI can't understand my mystake:
Posted by h1ci 3 Dec 2008 21:07
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n=1999;
    string s;
    int pl[100000], br=0, j=0, symb;
    while(getline(cin,s,'ç'))
    {
                             for(int i=0; i<s.size(); i++)
                             {
                                     if(s[i]=='\n'){ s.erase(i,1);}
                             }
                             symb=0;
                             for(;;)
                             {
                                    if(s.size()==1) {
                                                    if(s[0]=='?'){ cout << "Yes" << endl; return 0;}
                                                    else if(s[0]==' ') { cout << "No" << endl; return 0;}
                                                    else { cout << "No comments" << endl; return 0;}
                                                    }
                                    symb=symb+(n-1);
                                    symb=symb%s.size();
                                    s.erase(symb,1);
                             }
    }
    return 0;
}

Edited by author 07.03.2009 01:46

Edited by author 07.03.2009 01:46