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
- StableDiffusion #Unity #Inspector #Custom #WordRank
- SDK
- 이미지 엑스 박스
- collect2.exe
- Check that the SDK is installed properly
- vscode
- LNK1168
- NDK
- ue5
- jpg
- Android is not a valid platform
- AndroidStudio
- 코딩 테스트 #leetcode #two sum #coding test
- 1d returned
Archives
- Today
- Total
안경말이
[8393 c++] 백준 합 본문
문제를 보니 처음 코딩을 배울 때가 떠올랐습니다.
합을 저장할 변수를 0으로 초기화, 곱을 저장할 변수를 1로 초기화한다는 것이 혹 누군가에게 도움이 될까하여 간단히 글을 남깁니다.
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
int sum=0;
cin>>n;
for(int i=1; i<=n; i++)sum+=i;
cout<<sum;
}
'Coding Test > Baekjoon' 카테고리의 다른 글
[25304 c++] 백준 영수증 (2) | 2022.10.26 |
---|---|
[10818 c++] 백준 10818번 최소, 최대 (2) | 2022.10.23 |
[1978 c++] 백준 1978번 소수 찾기 (0) | 2022.10.22 |
Comments