| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- ogr2ogr
- 어셈블리어
- 설치완료안됨
- rwdImageMaps
- 반응형 페이지 좌표 변환
- GeoJSON object too complex/large
- netlify variables
- Error:error:0308010C:digital envelope routines::unsupported
- Sequelize Error: Dialect needs to be explicitly supplied as of v4.0.0
- expo
- AWS
- C언어
- ERR_PNPM_NO_GLOBAL_BIN_DIR
- AWS CodeBuild
- 김골라
- can't getting credentials
- react
- 이미지 좌표 추출
- SASS
- ins-32103
- NODE_VERSION
- AWS CodePipeline
- S3
- aws ec2
- node
- Unable to find the global bin directory
- EC2
- nodejs
- CSS
- credential error
- Today
- Total
목록Programming (38)
ImFe's study
문제) 123*456이라고 가정하면 123*6, 123*5, 123*4의 값과 123*456의 값이 필요하다. 123*일의 자리, 123*십의 자리, 123*백의자리 순으로 계산해 주어야 한다. #include 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)과 나누기 연산을 잘 활용하면 해당 자릿수만 이용 할 수 있다(정수형이여서 소숫점은 잘린다)
-문제 두 자연수 A와 B가 주어진다. 이때, A+B, A-B, A*B, A/B(몫), A%B(나머지)를 출력하는 프로그램을 작성하시오. #include int main() { int a, b; scanf("%d %d", &a, &b); printf("%d\n", a+b); printf("%d\n", a-b); printf("%d\n", a*b); printf("%d\n", a/b); printf("%d\n", a%b); return 0; } 시키는 대로 잘 따라하자 scanf에서 한 번에 정수 두 개를 입력받을 수 있다.
#include int main() { double a, b = 0; scanf("%lf", &a); scanf("%lf", &b); printf("%.9lf", a/b); return 0; } 10^-9까지 허용한다 했으니 double형을 사용해야 한다. printf("%.9lf", a/b); 는 a/b값을 소숫점 아래 9자리까지 표시한다는 의미이다
#include int main() { int a,b; scanf("%d", &a); scanf("%d", &b); printf("%d", a*b); return 0; }
#include int main() { int a=0; int b=0; scanf("%d", &a); scanf("%d", &b); printf("%d\n", a-b); return 0; } A+B문제와 유사함. int형 변수 선언 scanf로 입력 값 변수에 저장 서식 지정자
#include int main() { int a; int b; scanf("%d", &a); scanf("%d", &b); printf("%d", a+b); return 0; } int형 변수의 선언 scanf로 입력 값을 변수에 저장 서식지정자의 이용
#include int main() { printf("|\\_/|\n"); printf("|q p| /}\n"); printf("( 0 )\"\"\"\\\n"); printf("|\"^\"` |\n"); printf("||_/=\\\\__|\n"); return 0; } /* \t : 수평 tab tab(8)칸 띄우기 \n : 개행 커서를 한줄 밑으로 이동(enter와 같은효과) \' : '(쿼티션)을 표시 , 단독으로 '입력시 화면에 출력 x \" : "(더블 쿼티션) 표시 \\ : \(역슬래시 표시) */ 고양이 문제와 같은 방식이다.
#include int main() { printf("\\ /\\\n"); printf(" ) ( \')\n"); printf("( / )\n"); printf(" \\(__)|\n"); return 0; } /* \t : 수평 tab tab(8)칸 띄우기 \n : 개행 커서를 한줄 밑으로 이동(enter와 같은효과) \' : '(쿼티션)을 표시 , 단독으로 '입력시 화면에 출력 x \" : "(더블 쿼티션) 표시 \\ : \(역슬래시 표시) */ printf로 '(쿼티션) "(더블 쿼티션) \(역 슬래시)를 출력하기 위해선 모두 해당 문자 앞에 역슬래시를 붙여주어야 한다.