목록전체 글 (447)
printf("ho_tari\n");
#include #include #include #define lotto_max 45 #define lotto_num 7 int main(void) { int lottonum[lotto_num]; int duplicate; srand(time(NULL)); printf("\n"); printf("Randomly choose %d numbers from 1 ~ %d\n", lotto_num, lotto_max); for (int i = 0; i < lotto_num; ++i) { int randomnum; do { randomnum = rand() % lotto_max + 1; duplicate = 0; for (int j = 0; j < i; ++j) { if (lottonum[j] ==..
#include int main(void) { printf("%d %d %d\n", 100, 0144, 0x64); printf("%d 0%o 0x%x\n", 100, 100, 100); printf("%d %d %d\n", 'A', 'a', '0'); //printf("%d %d %d\n", 65, 97, 48); //printf("%c %c %c\n", 'A', 'A'+1, 'A'+2); printf("%c %c %c\n", 'A', 'a', '0'); printf("%c %c %c\n", 'A', 'A'+1, 'A'+2); printf("%lldLL\n", 10000000000LL); printf("%f %fF\n", 3.14, 2.718F); printf("%s\n", "ABCD"); return..
#include #include int main(void) { printf("CHAR_BIT : %d\n", CHAR_BIT); printf("CHAR_MIN : %d\n", CHAR_MIN); printf("CHAR_MAX : %d\n", CHAR_MAX); printf("INT_MIN : %d\n", INT_MIN); printf("INT_MAX : %d\n", INT_MAX); printf("LONG_MIN : %ld\n", LONG_MIN); printf("LONG_MAX : %ld\n", LONG_MAX); return 0; }
#include int main(void) { int year; scanf("%d", &year); int isOrdinary = !(year % 4 == 0 && year % 100 != 0 || year % 400 == 0); //int isOrdinary = (year % 4 != 0 || year % 100 == 0 && year % 400 == 0); printf("%d is a ordinary : %d\n", year, isOrdinary); return 0; }