Sicks Posted July 6, 2012 Report Share Posted July 6, 2012 (edited) Ola pessoalEstava fazendo um exercicio e sai com essa resolução:#include <stdio.h> #include<string.h> #include <conio.h> #include <math.h> #include<stdlib.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 == '{') conta[c]++; if(c == ')' || c == ']' || c == '}') contf[c]++; } if( conta['('] != contf[']'] || conta['['] != contf[']'] || conta['{'] != contf['}'] ) printf("N"); else printf("S"); n++; } }A resolução compila sem problemas mas o programa não executa essa linha c = getch(); <_< ele simplesmente pula elaalguém sabe qual poderia ser o problema?Ps: ele entra nos dois whiles mas simplesmente não executa essa linha :blink: Edited July 6, 2012 by Durub Adicionar tags code [Durub] Quote Link to comment Share on other sites More sharing options...
0 Klaudia Posted July 6, 2012 Report Share Posted July 6, 2012 Oi Moço, sou fraquinha em c + vou arriscar, rs. se você colocasse assim: c = getche();tenta aih.Pra que estas bibliotecas? #include <math.h>#include<stdlib.h> Quote Link to comment Share on other sites More sharing options...
Question
Sicks
Ola pessoal
Estava fazendo um exercicio e sai com essa resolução:
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 DurubAdicionar 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.