goorm 뱀이 지나간 자리, 피보나치 수열, 소수의 개수 구하기 #include using namespace std; int main(void){ int n, m; cin >> n >> m; int i=0; while(1){ i++; //1 if(i>n) break; for(int j = 0; j Algorithm/goorm 2020.08.25
goorm 문자열 뒤집기, 세로 순서 사각형, 숫자출력 s = input() print(s[::-1]) #include using namespace std; int main() { int n; cin >> n; int cnt = 1; for(int i = 1; i Algorithm/goorm 2020.08.24
goorm 헷갈리는 작대기, 피라미드, ASCII 코드 https://level.goorm.io/exam/47882/%ED%97%B7%EA%B0%88%EB%A6%AC%EB%8A%94-%EC%9E%91%EB%8C%80%EA%B8%B0/quiz/1 #include #include using namespace std; int main(void) { string s; int sum1 = 0; int sumI = 0; int suml = 0; int sumpipe = 0; getline(cin, s); for(int i = 0; s[i]; i++){ if(s[i] == '1') sum1++; if(s[i] == 'I') sumI++; if(s[i] == 'l') suml++; if(s[i] == '|') sumpipe++; } cout Algorithm/goorm 2020.08.22
goorm 절대값, 특정 문자 개수 구하기, 16 진수 #include using namespace std; int main(void) { int n; cin >> n; if( n < 0){ cout c; for(int i = 0; s[i]; i++){ if(s[i] == c) sum++; } cout Algorithm/goorm 2020.08.19
goorm 공백 없애기, 계산기, 삼각형의 넓이 #include #include using namespace std; int main(void) { string str; getline(cin, str); for (int i = 0; i n1 >> c >> n2; switch(c){ case '+': cout Algorithm/goorm 2020.08.19
goorm 비트연산 기본 1, 몫과 나머지, 윤년 (Leap Year) #include using namespace std; int main(void) { int n1, n2; cin >> n1>>n2; cout Algorithm/goorm 2020.08.17
goorm 약수의 합, 모양찍기, 소수 판별 #include using namespace std; int main(void) { int n; cin >> n; int sum = 0; for(int i = 1; i n; for(int i = n; i > 0; i--){ for(int j = 1; j Algorithm/goorm 2020.08.15
goorm 네 수의 곱, 비트연산 기본 2, Hello Goorm ! #include using namespace std; int mul(int a, int b){ return a*b; } int main(void){ int n1, n2, n3, n4; cin >> n1 >> n2>> n3 >> n4; cout > a >> b; int rst1 = a>>b; int rst2 = a Algorithm/goorm 2020.08.15
goorm Min 함수, 3의 배수 게임, 리그 횟수 경기 구하기 #include using namespace std; int Min(int a, int b){ if(a>b){ return b; } else{ return a; } } int main() { int n1, n2 = 0; cin >> n1 >> n2; cout > n; for(int i = 1; i Algorithm/goorm 2020.08.14
goorm 약수 구하기, 최소값, 369 게임 #include using namespace std; int main(void){ int n; // 양의 정수 cin >> n; for(int i = 1; i > input[i]; } min = input[0]; for(int j = 0; j input[j]){ min = input[j]; } } cout Algorithm/goorm 2020.08.12