사생활 보호 설정
https://gamjia.tistory.com
Updated News
Mini Rooms
답글수 [0]
What Friends Say
한마디로 표현해봐~
1촌평 관리
2231번 분해합
GamJia 2023. 3. 31. 09:17
단계별로 풀어보기 - 브루트 포스 - 2단계
https://www.acmicpc.net/problem/2231
#include <iostream> using namespace std; int main() { int N; cin>>N; for(int i=1;i<N;i++) { int temp=i; int count=i; while(temp>0) { count+=temp%10; temp/=10; } if(count==N) { cout<<i<<endl; return 0; } } if(N!=0) { cout<<0<<endl; } }