목록전체 글 (351)
printf("ho_tari\n");
#include int main(void) { //printf("1\n"); //printf("2\n"); //printf("3\n"); //... //printf("10\n"); int i; i = 1; while (i
#include #include long long power(int base, int exponent) { long long result = 1; for (int i = 0; i < exponent; ++i) { result *= base; } return result; } int main(void) { int base = 2; int exponent = 10; long long result = power(base, exponent); printf("%d^%d = %lld\n", base, exponent, result); return 0; }
#include long long power(int base, int exponent) { long long result = 1LL; for (int i = 1; i
#include #include "empty.h" int main() { Empty e1; const Empty e2 = e1; e1 = e2; Empty *p1 = &e1; // e1.operator&() const Empty *p2 = &e2; // e2.operator&() return 0; } #ifndef EMPTY_H #define EMPTY_H class Empty { public: //Empty() { } //Empty(const Empty& rhs) { /* memberwise copy */ } //~Empty() { } //Empty& operator=(const Empty& rhs) { /* memberwise copy */ } //Empty *operator&() { return t..
#include int main(void) { int num; scanf("%d", &num); if (num > 0) { printf("%d is a positive number\n", num); } else if (num == 0) { printf("%d is zero number\n", num); } else { printf("%d is a negative number\n", num); } return 0; } #include int main(void) { int num; scanf("%d", &num); /* if (num > 0) { printf("%d is a positive number\n", num); } else if (num == 0) { printf("%d is zero number\..