Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- autonomous vehicle
- DynamicProgramming
- solver
- Frenet Coordinate
- 백준
- 공유라이브러리
- 수치최적화
- path planning
- Dubins Path
- self driving car
- OSQP
- 선형대수
- 경로생성
- C
- 동적라이브러리
- CPP
- 소프티어
- Hybrid A star
- Recursion
- Leetcode
- 정적라이브러리
- GNN
- MDP
- CUDA
- Graph Neural Network
- 강화학습
- Motion Planning
- GIT
- C++
- PathPlanning
Archives
- Today
- Total
Swimmer
[백준] 곱셈, 2588, C/C++ 본문
- 포인트
- 수 자리의 자연수에서 1, 10, 100의 자릿수에 해당하는 값을 뽑아낼 수 있는가?
- 답안 코드 작성은 쉽지만, 최적화할 요소가 꽤 많은 문제로 느껴짐. 고민해보지 않았다.
#include <stdio.h>
typedef unsigned long int uint32_t;
int main()
{
uint32_t u32FirstVal = 0, u32SecondVal = 0;
scanf("%d", &u32FirstVal);
scanf("%d", &u32SecondVal);
uint32_t u32a = 0, u32b = 0, u32c = 0;
u32a = u32SecondVal % 10;
u32b = (u32SecondVal / 10) % 10;
u32c = u32SecondVal / 100;
uint32_t u32d = 0, u32e = 0, u32f = 0;
u32d = u32FirstVal * u32a;
u32e = u32FirstVal * u32b;
u32f = u32FirstVal * u32c;
printf("%d \n", u32d);
printf("%d \n", u32e);
printf("%d \n", u32f);
uint32_t u32RetVal = 0;
u32RetVal = (u32f * 100) + (u32e * 10) + u32d;
printf("%d \n", u32RetVal);
}
'코딩 문제' 카테고리의 다른 글
[백준] 행렬 덧셈, 2738, C (0) | 2022.11.21 |
---|---|
[백준] 알람 시계, 2884, C/C++ (0) | 2022.11.20 |
[백준] 윤년 2753, C/C++ (0) | 2022.11.19 |
[소프티어] 성적 평균 (0) | 2021.10.19 |
[소프티어] 스마트 물류 (0) | 2021.10.19 |
Comments