#include <stdio.h> #include <time.h> int main(void) { clock_t start, end; long i, j = 1; start = clock(); for( i = 0; i <= 1000000000; ++i ) { j *= 1024 * 1024 * 1024; j /= 1024 * 1024 * 1024; } end = clock(); printf("time=%f/n", (double)(end-start)/CLOCKS_PER_SEC); start = clock(); for( i = 0; i <= 1000000000; ++i ) { j <<= 30; j >>= 30; } end = clock(); printf("time=%f/n", (double)(end-start)/CLOCKS_PER_SEC); printf("%d/n", j); return 0; }