#include #include /* * Instructions: * Compose a string to copy into "buffer" which * overflows "buffer", and causes the following: * a is divisible by 3 * b is divisible by 8 * c is divisible by 100 * Do not modify anything in main! * Your program must terminate properly * No segmentation faults! */ void foo(char* buffer) { strcpy(buffer, "shark"); } int main() { char buffer[32]; int a = 10; int b = 15; int c = 25; foo(buffer); printf("a = %d, b = %d, c = %d\n", a, b, c); printf("a = %x, b = %x, c = %x\n", a, b, c); int points = 0; if(a%3 == 0) { printf("PASS a\n"); points++; } if(b%8 == 0) { printf("PASS b\n"); points++; } if(c%100 == 0) { printf("PASS c\n"); points++; } if(a%3 == 0 && b%8 == 0 && c%100 == 0) printf("You win!!!\n"); else printf("Not yet - keep trying!\n"); if(a == 99) printf("\x53\x75\x70\x65\x72\x20\x53\x65\x63\x72\x65\x74\x20\x42\x6f\x6e\x75\x73\x20\x45\x61\x72\x6e\x65\x64\x20\x21\x21\x21\n"); return 0; }