Jump to content
Fórum Script Brasil
  • 0

Resolução de exercico não esta funcionando



Ola pessoal

Estava fazendo um exercicio e sai com essa resolução:

#include <stdio.h>
#include <conio.h>
#include <math.h>

int main () {
int nt,n,conta[128],contf[128];
char c=0;

scanf("%d", &nt);

while(nt != n)
         while(c != '\n')
                 c = getchar();
                 if(c == '(' || c == '[' || c == '{')
                 if(c == ')' || c == ']' || c == '}')
if( conta['('] != contf[']'] || conta['['] != contf[']'] || conta['{'] != contf['}'] )

A resolução compila sem problemas mas o programa não executa essa linha c = getch(); <_<

ele simplesmente pula ela

alguém sabe qual poderia ser o problema?

Ps: ele entra nos dois whiles mas simplesmente não executa essa linha :blink:

Edited by Durub
Adicionar tags code [Durub]
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...