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 1563. Bayan

No subject
Posted by prog_islam 10 Apr 2015 15:10
where is non-zero exit code in my code solving Bayan problem please help me
#include<iostream>
#include<cstring>

using namespace std;

int main()
{
    char nmat[1000][31];
    int no=0;
    int n;
    cin>>n;
    cin.ignore();
    if(1<=n&&n<=1000)
    {
    for(int i=0;i<n;i++)
        cin.getline(nmat[i],30);
    for(int i=1;i<n;i++)
    {
        for(int j=i-1;j>=0;j--)
        {
            if((strcmp(nmat[i],nmat[j]))==0)
            {
                no++;
                break;
            }
        }
    }



    cout<<no;
    }
    system("pause");
    return 0;
}