রানটাইম এরর দেখাচ্ছে। কিন্তু ভুলটা ধরতে পারছি না। সমস্যা লিঙ্ক: http://cpbook.subeen.com/2016/02/blog-post_37.html

 #include <stdio.h>
 #include <string.h>
 int main()
 {
    int i, j, t, b;
    char s[1001];
    int count[52];
    scanf("%d ", &t);
    for (i = 0; i < t; i++)
    {
        gets(s );
        int b = strlen(s);
        for (j = 0; j < 52; j++)
        {
            count[j] = 0;
        }
        for (j = 0; j < b; j++)
        {
            if (s[j] >= 'A' && s[j] <= 'Z')
            {
                count[s[j] - 'A']++;
            }
            if (s[j] >= 'a' && s[j] <= 'z')
            {
                count[(s[j] - 'a') + 26]++;
            }
        }
        for (j = 0; j < 52; j++)
        {
            if (count[j] != 0)
            {
                if (j >= 0 && j <= 25)
                {
                    printf("%c = %d\n",'A'+j,count[j]);
                }
                else
                {
                    printf("%c = %d\n",71+j,count[j]);
                }
            }
        }
    }
 }

asked 31 Oct, 18:10

nishat's gravatar image

nishat
615

edited 04 Nov, 16:45


কোড ঠিক অাছে (I hope)। মেইন ফাংশনের শেষে return 0 অ্যাড করলেই এসি অাসবে।

permanent link

answered 05 Nov, 13:14

unreleased's gravatar image

unreleased
513

হ্যাঁ, accepted হয়েছে।অসংখ্য ধন্যবাদ।

(06 Nov, 13:57) nishat
Your answer
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:

×353
×76
×37
×34
×2

question asked: 31 Oct, 18:10

question was seen: 84 times

last updated: 06 Nov, 13:57