언어(Language)(44)
-
[Do it! 자바스크립트 입문] 05장 함수와 이벤트
1번) function sumMulti(num1,num2){ if(num1==num2){ return num1*num2; } else{ return num1+num2; } } console.log(sumMulti(5,10)); console.log(sumMulti(10,10)); 개선해야 할 점) 1. 험수를 더 간결히 할 수 있을 것 같다 2. 변수명 고민하기 2번) var n1=prompt("비교될 첫 번째 숫자:"); var n2=prompt("비교될 두 번째 숫자:"); compare(n1,n2); function compare(x,y){ if(x>y) alert(x+"이(가) "+y+"보다 큽니다."); else if(x
2023.01.02 -
[Do it! 자바스크립트 입문] 04장 제어문
1번) 짝수일까, 홀수일까 책 답) 짝수일까, 홀수일까 보완할 점 1. css에서 폰트 사이즈 조절 2. 책에서는 취소하는 경우를 고려했음 2번) 3의 배수 찾기 책에 있는 답) 3의 배수 찾기 개선해야 될 점 : 태그 활용!
2023.01.01 -
명품 C++ Programming 실습문제 ch01
[1번]#include int main() { std::cout [2번]#include using namespace std;int main() { cout [3번]#include using namespace std;int main() { cout [4번]#include using namespace std;int main() { for (int i = 0; i
2022.11.29 -
수업 교재 ch17 Console Input-Ouput
[Exercise 17-1. CONSOLA 사용하기] #include using namespace std; #include "Consola.h" int main() { gotoxy(10, 5); cout
2022.11.29 -
[중간대비] ch05 Function & Preprocess
[Exercise5-1 함수 만들기] 두 값을 더하는 int Plus(int a, int b)와 빼는 int Minus(int a, int b)를 작성하고, 사용자로부터 두 수를 입력 받아 Plus, MInus 값을 두 함수를 이용하여 계산한 후, 다음과 같이 출력하라 실행 예) #include using namespace std; int Plus(int a, int b) { return a + b; } int Minus(int a, int b) { return a - b; } int main() { int x, y; cout > x >> y; cout
2022.10.27 -
[중간대비] ch04 Control Flow
[Exercise 4-1 switch문 사용하기] 입력된 문자들 중 'a'/'A','b'/'B'나 다른 문자들의 개수를 count하는 프로그램을 작성하시오. +)사용자로부터 문자들을 입력받아, a/A, b/B 문자 개수를 헤아리는 프로그램이다. 반복문과 함께 분기문(switch 문장)을 적절히 사용하자. 사용자가 입력하는 문자를 하나씩 읽어 들이는 코드는 다음과 같다. int ch; while((ch=cin.get()) != '\n') { ... } 실행 예) 내 코드) #include using namespace std; int main() { int ch, aCount = 0, bCount = 0, otherCount = 0; while ((ch = cin.get()) != '\n') { //사용자가..
2022.10.27