C语言中的断言

引例 假设要求程序输入两个数先后为X和Y,要求 X >= Y,否则即认为程序错误。代码如下。 // assert.c #include <stdio.h> #include <assert.h> int main() { double x, y, z; puts("Enter X and Y (X > Y): "); while (scanf("%lf%lf", &x, &y) == 2
相关文章
相关标签/搜索