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 1545. Hieroglyphs

Why 13 test "CRASH" ??
Posted by =NeRRouZ= 22 Apr 2011 00:17
#include <iostream>
using namespace std;

int main()
{
    int n;
    int i;
    char s;
    char a[1001];
    cin>>n;

    for (i = 0; i<n*2; i++)
        cin>>a[i];
    cin>>s;
    for (i=0; i<n*2; i++)
    {


        if (s == a[i] && i % 2 == 0)
           cout<<a[i]<<a[i+1]<<endl;
    }


    system("pause");
    return 0;
}
Re: Why 13 test "CRASH" ??
Posted by AterLux 23 Apr 2011 02:56
a[1001] should be a[2000] at least;
Re: Why 13 test "CRASH" ??
Posted by =NeRRouZ= 24 Apr 2011 15:20
Thanks )))