일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- nodejs
- NODE_VERSION
- Unable to find the global bin directory
- Sequelize Error: Dialect needs to be explicitly supplied as of v4.0.0
- 반응형 페이지 좌표 변환
- netlify variables
- credential error
- expo
- AWS CodeBuild
- AWS
- 설치완료안됨
- 이미지 좌표 추출
- node
- S3
- can't getting credentials
- aws ec2
- ogr2ogr
- SASS
- CSS
- 김골라
- GeoJSON object too complex/large
- EC2
- react
- ERR_PNPM_NO_GLOBAL_BIN_DIR
- rwdImageMaps
- Error:error:0308010C:digital envelope routines::unsupported
- C언어
- 어셈블리어
- 이미지 맵
- AWS CodePipeline
- Today
- Total
목록Programming (37)
ImFe's study
-문제 두 자연수 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에서 한 번에 정수 두 개를 입력받을 수 있다.
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/mm4G2/btqPsCC1Rae/roL0x8C7kAJcpTQbmgX3m1/img.png)
#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로 '(쿼티션) "(더블 쿼티션) \(역 슬래시)를 출력하기 위해선 모두 해당 문자 앞에 역슬래시를 붙여주어야 한다.