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

int main()
{
    int n;
    scanf("%d\n",&n);
    int i,x=0;
    char p[150];

    for (i=0; i<n; i++)
    {
        gets(p);
        if (p[0]=='+' && p[1]=='+'|| p[1]=='+'&& p[2]=='+')
            x++;
        if (p[0]=='-' && p[1]=='-'|| p[1]=='-'&& p[2]=='-')
            x--;
    }

    printf("%d",x);
}

scanf("%d",&n) দিলে কাজ করছে না, কিন্তু scanf("%d\n",&n) দিলে কাজ করার কারণ কী?

asked 20 May, 23:25

Aryan_robin's gravatar image

Aryan_robin
112

edited 21 May, 08: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:

×381

question asked: 20 May, 23:25

question was seen: 69 times

last updated: 21 May, 08:53