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 |
Tags
- AWS CodeBuild
- 김골라
- AWS CodePipeline
- S3
- Unable to find the global bin directory
- aws ec2
- ERR_PNPM_NO_GLOBAL_BIN_DIR
- nodejs
- CSS
- C언어
- netlify variables
- SASS
- 이미지 맵
- 반응형 페이지 좌표 변환
- ogr2ogr
- 이미지 좌표 추출
- GeoJSON object too complex/large
- rwdImageMaps
- AWS
- credential error
- can't getting credentials
- react
- Error:error:0308010C:digital envelope routines::unsupported
- node
- EC2
- 어셈블리어
- NODE_VERSION
- Sequelize Error: Dialect needs to be explicitly supplied as of v4.0.0
- 설치완료안됨
- expo
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