Solución al problema número 415 de AceptaelReto - 415.

Cualquier duda no dudes en contactar.

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int num;
    while(scanf("%d",&num)==1 && num!=0)
    {
        if(num%9 == 0) printf("SI\n");
        else printf("NO\n");
    }
    return 0;
}
/*
10 = 10-1 = 9
12 = 21-12 = 9
13 = 31-13 = 18
14 = 41-14 = 27
15 = 51-15 = 36
16 = 61-16 = 45
17 = 71-17 = 54
18 = 81-18 = 63
19 = 91-19 = 72
20 = 20-2 =  18
21 = 21-12 = 9
23 = 32-23 = 9
24 = 42-24 = 18
89 = 98-89 = 9
4321 = 4321-1234 = 3087%9 == 0
9875 = 9875-5789 = 4086%9 == 0
*/

No te pierdas nada.

Sigue en contacto con Isaac Lozano Osorio!