|
2#
楼主 |
发表于 2007-8-24 11:39:59
|
只看该作者
请帮忙,谢谢! 附上格式化后的源代码:
1F/*
2FC TESTBED VERSION : 7.0.1
3FFILE UNDER TEST : "C:\Testbed\Example5.c"
4FDATE OF ANALYSIS : Fri Aug 24 09:32:56 2007
5F*/
6F
7Fint
8T coverage1 (
9F int A ,
10F int B ,
11F int C )
12F {
13F int
14F D ;
15T D = 0 ;
16T if
17T (
18T A
19T &&
20T (
21T B
22T ||
23T C
24T )
25T )
26T {
27T D = 1 ;
28T }
29T else
30T {
31T D = 0 ;
32T }
33T ;
34T return
35T ( D ) ;
36F }
37F
38Fint
39T coverage2 (
40F int A ,
41F int B ,
42F int C )
43F {
44F int
45F D ,
46F z ;
47T D = 0 ;
48T z =
49T (
50T A
51T &&
52T (
53T B
54T ||
55T C
56T )
57T ) ;
58T if
59T (
60T z
61T )
62T {
63T D = 1 ;
64T }
65T else
66T {
67T D = 0 ;
68T }
69T ;
70T return
71T ( D ) ;
72F }
73F
74Fint
75T coverage3 (
76F int A ,
77F int B ,
78F int C )
79F {
80F int
81F D ;
82T D = 0 ;
83T if
84T (
85T A
86T ||
87T (
88T B
89T &&
90T C
91T )
92T )
93T {
94T if
95T (
96T A
97T &&
98T (
99T B
100T ||
101T C
102T )
103T )
104T {
105T D = 1 ;
106T }
107T else
108T {
109T D = 0 ;
110T }
111T ;
112T }
113T else
114T {
115T D = 0 ;
116T }
117T }
118F
119T main()
120F {
121F int
122F A [ 9 ] = { 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 } ;
123F int
124F B [ 9 ] = { 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 } ;
125F int
126F C [ 9 ] = { 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 } ;
127T
128T coverage1 (
129T A [ 1 ] , B [ 1 ] , C [ 1 ] ) ;
130T
131T coverage1 (
132T A [ 3 ] , B [ 3 ] , C [ 3 ] ) ;
133T
134T coverage1 (
135T A [ 4 ] , B [ 4 ] , C [ 4 ] ) ;
136T
137T coverage1 (
138T A [ 6 ] , B [ 6 ] , C [ 6 ] ) ;
139T
140T coverage2 (
141T A [ 1 ] , B [ 1 ] , C [ 1 ] ) ;
142T
143T coverage2 (
144T A [ 3 ] , B [ 3 ] , C [ 3 ] ) ;
145T
146T coverage2 (
147T A [ 4 ] , B [ 4 ] , C [ 4 ] ) ;
148T
149T coverage2 (
150T A [ 6 ] , B [ 6 ] , C [ 6 ] ) ;
151T
152T coverage3 (
153T A [ 1 ] , B [ 1 ] , C [ 1 ] ) ;
154T
155T coverage3 (
156T A [ 3 ] , B [ 3 ] , C [ 3 ] ) ;
157T
158T coverage3 (
159T A [ 4 ] , B [ 4 ] , C [ 4 ] ) ;
160T
161T coverage3 (
162T A [ 6 ] , B [ 6 ] , C [ 6 ] ) ;
163T printf ( " done\n" ) ;
164T }
165F |
|