목록전체 글 (351)
printf("ho_tari\n");
#include int main(void) { int a; int *p; a = 100; p = &a; *p = 200; printf("a: %d\n", a); return 0; }
#include int main(void) { int score; printf("input score : "); scanf("%d", &score); int isPass = (score >= 60); printf("score : %d - pass : %d\n", score, isPass); return 0; } #include int main(void) { int score; printf("input score : "); scanf("%d", &score); //int isPass = (score >= 60); //printf("score : %d - pass : %d\n", score, isPass); if (score >= 60) { printf("score : %d --- pass\n", score..
#include int main(void) { int year; scanf("%d", &year); //int isLeap = (year % 4 == 0 && year % 100 != 0 || year % 400 == 0); //int isLeap = (year % 400 == 0 || year % 4 == 0 && year % 100 != 0); //printf("%d is leap : %d\n", year, isLeap); if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) { printf("%d is a leap year\n", year); } else { printf("%d is an ordinary year\n", year); } return 0..
#include #include "string.h" int main() { String s1; String s2 = "hello, world"; // String s2("hello, world"); //String s2 = 0; String s3 = s2; // String s3(s2); s1 = s2; // s1 = s1; // self assignment?? s1 = "hello, "; // String tmp("hello, "); s1 = tmp; tmp.~String(); String s4 = " IoT"; s1 = s2 + s4; if (s1 == s2) { std::cout str, rhs.str) == 0; } bool String::operator!=(const String& rhs) co..
#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..