Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
8335 maxcodehac 1
 
2
   GNU UnRTF, a command-line program to convert RTF documents to other formats.
3
   Copyright (C) 2000,2001 Zachary Thayer Smith
4
5
 
6
   it under the terms of the GNU General Public License as published by
7
   the Free Software Foundation; either version 2 of the License, or
8
   (at your option) any later version.
9
10
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
   GNU General Public License for more details.
14
15
 
16
   along with this program; if not, write to the Free Software
17
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
 
20
=============================================================================*/
21
22
 
23
 * Program name:   bcount
24
 * Author name:    Zach Smith
25
 * Create date:    15 Oct 00
26
 * Purpose:        Counts the number of opening and closing braces while
27
 *                 reading from stdin.
28
 *--------------------------------------------------------------------*/
29
30
 
31
 
32
 
33
main (){
34
	int n1,n2;
35
	int ch;
36
	n1=n2=0;
37
	while (EOF!=(ch=getchar())) {
38
		if (ch=='}') ++n1;
39
		if (ch=='{') ++n2;
40
	}
41
	printf ("{=%d, }=%d\n", n2,n1);
42
}
43