목록C (66)
printf("ho_tari\n");
#include int main(void) { int num; printf("input num : "); scanf("%d", &num); //int isOdd = (num % 2 == 1); //int isEven = (num % 2 == 0); //printf("%d is odd : %d\n", num, isOdd); if (num % 2 /* == 1*/) { printf("%d is odd\n", num); } else { printf("%d is even\n", num); } return 0; } #include int main(void) { int num; printf("input num : "); scanf("%d", &num); //int isOdd = (num % 2 == 1); //in..
#include int main(void) { printf("Name: hotari\nPhone: 010-####-****\nE-mail: ericsungho@naver.com\n"); return 0; }
#include int main(void) { int a, b, c; printf("input 3 num : "); scanf("%d %d %d", &a, &b, &c); int max, mid, min; max = a; if (b > max) { max = b; } if (c > max) { max = c; } min = a; if (b < min) { min = b; } if (c < min) { min = c; } mid = a + b + c - max - min; printf("max : %d\nmid : %d\nmin : %d\n", max, mid, min); return 0; } #include int main(void) { int a, b, c; scanf("%d %d %d", &a, &b..
#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; }