Counting the number of if and else excluding the nested if-else

前端 未结 3 864
渐次进展
渐次进展 2021-01-22 05:50

Can anyone tell me how can i write a program where i have to read a c program from a text file and then count the number of if-else statements, excluding the nested if-else. Her

3条回答
  •  生来不讨喜
    2021-01-22 06:39

    Without seeing the original file to read, I would use regex to count the total number of if/else and then count the number of nested if/else. The math for the result should be pretty simple... :)

提交回复
热议问题