#include <stdio.h>
#include <string.h>

int compare(char S1[],char S2[])
{
    int i;
    int count =0;
    int len=strlen(S1);
    for (i=0; i<strlen(S1); i++)
    {
        if(S1[i]==S2[i])
            count++;
    }

    if (count ==len)
        return 1;
    else
        return 0;
}

int main()
{
    char S[1000];
    scanf("%s",S);
    int len=strlen(S);
    int i,j=0;
    char input[5]="hello";
    char out[5];
    for(i=0; i<len; i++)
    {
        if(S[i]==input[j])
        {
            out[j]=S[i];
            j++;
        }
    }

    out[j]='\0';
    //printf("%d\n",strcmp(input,out));
    if (compare(input,out))
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
    //printf("%s\n",out);

    return 0;
}

এটা কোডফোর্সেস ৫৮এ সমস্যার আমার সমাধান। কিন্তু এটা রঙ দেখাচ্ছে। কিন্তু আমার কম্পিউটার এ ঠিক উত্তর আসে। কারণটা জানাবেন?

asked 24 May, 16:07

Aryan_robin's gravatar image

Aryan_robin
112

edited 24 May, 16:53

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
24618

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×85

question asked: 24 May, 16:07

question was seen: 60 times

last updated: 24 May, 16:53