Advertisement
Guest User

Untitled

a guest
Nov 9th, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. char checkCharacter(char character);
  4. int numberOfBrackets = 0;
  5. int main()
  6. {
  7.     printf("0");
  8.     char character ="";
  9.     while(character!=EOF)
  10.     {
  11.         character = getchar();
  12.         checkCharacter(character);
  13.     }
  14.     return 0;
  15. }
  16.  
  17. char checkCharacter(char character)
  18. {
  19.     if(character == '{')
  20.     {
  21.         numberOfBrackets++;
  22.     }
  23.     if(character == '}')
  24.     {
  25.         numberOfBrackets--;
  26.     }
  27.     if(character == '\n')
  28.     {
  29.     }
  30.     if(character != '\n'||character != '}'|| character != '{')
  31.     {
  32.         putchar(character);
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement