(a + 1) 永遠 > a, 那可未必
(高顯忠, sjgau4311@gmail.com, 2011-10-02 10:16)
1樓
#if 0
a= 10, b= 11
請按任意鍵繼續 . . .
a= 2147483647, b= -2147483648
請按任意鍵繼續 . . .
#endif
// ----------------------------------------------
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int a, b, c;
a= 10;
b= a + 1;
printf("\n a= %d, b= %d\n", a, b);
system("PAUSE");
// b > a
while (b > a) {
a= a + 1;
b= a + 1;
}
// b <= a
printf("\n a= %d, b= %d\n", a, b);
system("PAUSE");
return EXIT_SUCCESS;
}