목록전체 글 (316)
printf("ho_tari\n");
#include int main(void) { int a, b; printf("input 2 nums : "); scanf("%d %d", &a, &b); printf("%d > %d : %d\n", a, b, a > b); printf("%d = %d : %d\n", a, b, a >= b); printf("%d
#include #define pi 3.14 int main(void) { int r; printf("r: "); scanf("%d", &r); double circle; circle = r * r * pi; printf("------------------------\n"); printf("Circle Area: %.2f\n", circle); return 0; }
#include int main(void) { int celsius; double fahr; scanf("%d", &celsius); fahr = 9.0 / 5.0 * celsius + 32; printf("celsius : %d ---> fahr : %.1f\n", celsius, fahr); return 0; }
#include int main(void) { int nums[10] = {50, 90, 30, 100, 80, 10, 20, 40, 70, 60}; //initialized list // bubble sorting for (int i = 9; i >= 1; --i) { for (int j = 0; j nums[j+1]) { int tmp = nums[j]; nums[j] = nums[j+1]; nums[j+1] = tmp; } } } for (int i = 0; i < 10; ++i) { printf("%d ", nums[i]); } printf("\n"); return 0; }
#include int main(void) { char ch; scanf("%c", &ch); if(ch >= 'A' && ch
#include #include #include int main(void) { int question[3]; srand(time(NULL)); question[0] = rand() % 9 + 1; do { question[1] = rand() % 9 + 1; }while(question[0] == question[1]); do { question[2] = rand() % 9 + 1; }while(question[0] == question[2] || question[1] == question[2]); printf("question: %d %d %d\n", question[0], question[1], question[2]); int count = 0; for(;;) // while(1) { ++count;..
#include int main(void) { int a, b, c; printf("Korean: "); scanf("%d", &a); printf("English: "); scanf("%d", &b); printf("Math: "); scanf("%d", &c); int sum; double average; sum = a + b + c; average = sum / 3.0; printf("-----------------------\n"); printf("Sum: %d\nAverage: %.2f\n", sum, average); return 0; }