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
相關文章
相關標籤/搜索