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 |
Tags
- C언어
- Error:error:0308010C:digital envelope routines::unsupported
- 어셈블리어
- Unable to find the global bin directory
- ERR_PNPM_NO_GLOBAL_BIN_DIR
- GeoJSON object too complex/large
- credential error
- netlify variables
- CSS
- aws ec2
- react
- SASS
- 설치완료안됨
- can't getting credentials
- EC2
- 이미지 좌표 추출
- Sequelize Error: Dialect needs to be explicitly supplied as of v4.0.0
- AWS CodeBuild
- NODE_VERSION
- AWS
- rwdImageMaps
- ogr2ogr
- 반응형 페이지 좌표 변환
- 이미지 맵
- AWS CodePipeline
- 김골라
- S3
- expo
- nodejs
- node
Archives
- Today
- Total
ImFe's study
[C] 2588번 - 곱셈 본문
문제)
123*456이라고 가정하면
123*6, 123*5, 123*4의 값과 123*456의 값이 필요하다.
123*일의 자리, 123*십의 자리, 123*백의자리 순으로 계산해 주어야 한다.
#include <stdio.h>
int main()
{
int a,b=0;
scanf("%d %d", &a, &b);
printf("%d\n", a*(b%10));
printf("%d\n", a*((b/10)%10));
printf("%d\n", a*(b/100));
printf("%d", a*b);
return 0;
}
나머지 연산(modulo)과 나누기 연산을 잘 활용하면 해당 자릿수만 이용 할 수 있다(정수형이여서 소숫점은 잘린다)
'Programming > C언어 백준 풀이' 카테고리의 다른 글
[C] 1330번 - 두 수 비교하기 (0) | 2020.12.08 |
---|---|
[C] 10430번 - 나머지 (0) | 2020.12.08 |
[C] 10869 - 사칙연산 (0) | 2020.12.08 |
[C] 1008번 - A/B (0) | 2020.12.07 |
[C] 10998번 - AxB (0) | 2020.12.07 |
Comments