Short Cake
Editing a Mii - Nintendo Wii U

사생활 보호 설정

https://gamjia.tistory.com

Mini Rooms

  • 내 미니룸
  • 미니미설정
  • 미니룸설정
  • 답글수 [0]

What Friends Say

한마디로 표현해봐~

1촌평 관리

4673번 셀프 넘버

GamJia 2023. 3. 24. 09:10

단계별로 풀어보기 - 함수 - 2단계

https://www.acmicpc.net/problem/4673

#include <iostream>
using namespace std;
int d(int n)
{
    int temp=n;
    while(n!=0)
    {        
        temp+=n%10;    // 원래 숫자+십의 자리 숫자+일의 자리 숫자
        n=n/10;        
    }
    return temp;
}

bool arr[10001];  

int main()
{      
    for(int i=1;i<=10000;i++)
    {
        int x=d(i);          
        if(x<=10001)        
        {
            arr[x]=true;    
        }
    }
    
    for(int i=1;i<=10000;i++)
    {
        if(!arr[i])
        {
            cout<<i<<endl;
        }
    }
    return 0;
}

'BaekJoon' 카테고리의 다른 글

11654번 아스키 코드  (0) 2023.03.24
1065번 한수  (0) 2023.03.24
15596번 정수 N개의 합  (0) 2023.03.24
4344번 평균은 넘겠지  (0) 2023.03.24
8958번 OX퀴즈  (0) 2023.03.24