Hướng dẫn divisible by 3 c++ - chia hết cho 3 c ++

Đưa ra một số, nhiệm vụ là chúng tôi chia số cho 3. Số đầu vào có thể lớn và có thể không thể lưu trữ ngay cả khi chúng tôi sử dụng int.examples dài dài: & nbsp; & nbsp;
Examples: 
 

Show
    Input  : n = 769452
    Output : Yes
    
    Input  : n = 123456758933312
    Output : No
    
    Input  : n = 3635883959606670431112222
    Output : Yes

    Vì số đầu vào có thể rất lớn, chúng tôi không thể sử dụng N % 3 để kiểm tra xem một số có chia hết cho 3 hoặc không, đặc biệt là bằng các ngôn ngữ như C/C ++. Ý tưởng này dựa trên thực tế sau. & NBSP;
     

    Một số được chia cho 3 nếu tổng các chữ số của nó chia hết cho 3.

    Minh họa: & nbsp; & nbsp; 
     

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.

    Điều này hoạt động như thế nào? & NBSP; 

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.

    Dưới đây là việc thực hiện thực tế trên: & nbsp;
     

    C++

    #include

    using namespace std;

    int check(string str)

    {

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0__
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    2

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0__
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    5

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0____17
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8int
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    0

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    2
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    3
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    7

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    int #include0

    {

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0#include3#include4#include5

    ____10#include7#include8 #include9using0#include5

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6 using4

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    Java

    using6 using7

    {

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0____50 namespace1 namespace2

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1int
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    2

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1int std;0std;1#include5

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    7
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8int std;7std;1std;9

    int0int1

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    3
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6 int6int7 int8std;1
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0check(string str)4 namespace0 check(string str)6 check(string str)7

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1{1#include4#include5

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1{5{6

    int0{8#include8

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    02

    int0{8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    05
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    Python3

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    10
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    11

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    13
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    14 std;1

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    17
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    18std;1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    20

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    222____114
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    24
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    25
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    26

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    13
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    14
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    13
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    31
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    32

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    24
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    14
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    24
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    37
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    26

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    41
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    25

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    24
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    14
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    50

    {5

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    52

    ____10

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    54
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8#include8
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    47

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    02
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    20

    ____10

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    54
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    05
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    47

    C#

    using

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    66

    using6

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    68

    {

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0____50
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    72
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    73
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    74
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    75

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1int
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    80

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1int
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    5

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    7
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8int
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    88

    int0

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    90
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    3
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    7

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0check(string str)4 namespace0 check(string str)6
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    02

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    74
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    07#include4#include5

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1{5{6

    int0

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    14#include8
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    02

    int0

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    14
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    05
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    PHP

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    26

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    27
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    73
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    29
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    47

    {

    ____10

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    33
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    34
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    35
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    29
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    40
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    41

    ____10

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    7
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    45

    Các

    ____10

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    40
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    66

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    29
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    34#include4#include5

    Is

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    80
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    72
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    84

    JavaScript

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    85

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    27
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    87

    {

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    90

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    92

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    7
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    95

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    90
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    3
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    7

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    #include04#include4#include5

    int #include0

    #include12

    #include13

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0#include3#include4#include5: O(logn), where n is the given number.

    ____10#include7#include8 #include9using0#include5O(1), as we are not using any extra space. 

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6 using4
    Checking given number is divisible by 3 or not by using the modulo division operator “%”. 

    C++

    #include14

    using namespace std;

    int #include0

    {

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0#include3#include4#include5

    ____10#include7#include8 #include9using0#include5

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1#include32#include8#include5

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    02

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1#include32
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    05#include5

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    6 using4

    Java

    Java

    using6 using7

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0____50 namespace1 namespace2

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1int
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    2

    #include55{

    ____10#include22 #include64#include65#include5

    ____10{5 #include69__777 int8std;1#include73

    #include74{8#include8

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    02 {

    #include74{8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    05
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    #include55

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    Python3

    #include92

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    14#include65

    Is

    #include55

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    54
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8#include8
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    47

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    02
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    20

    #include55

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    54
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    8
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    05
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    47

    C#

    using

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    66

    check(string str)4 using6 using20

    #include55namespace0 check(string str)4 check(string str)6 using25

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0#include22 using28

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{5 using31

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{

    #include74using35#include8

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    02

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0{

    #include74using35

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    05
    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    4

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0using49

    #include55

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    8

    JavaScript

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    85

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1using55 using56

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1{5 using31

    int0using61#include8

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    47

    Let us consider 1332, we can write it as
    1332 = 1*1000 + 3*100 + 3*10 + 2
    
    The proof is based on below observation:
    Remainder of 10i divided by 3 is 1
    So powers of 10 only result in value 1.
    
    Remainder of "1*1000 + 3*100 + 3*10 + 2"
    divided by 3 can be written as : 
    1*1 + 3*1 + 3*1 + 2 = 9
    The above expression is basically sum of
    all digits.
    
    Since 9 is divisible by 3, answer is yes.
    1
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    02

    int0using61

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    05
    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    47

    For example n = 1332
    Sum of digits = 1 + 3 + 3 + 2
                 = 9
    Since sum is divisible by 3,
    answer is Yes.
    0#include13

    Độ phức tạp về thời gian: O (1) vì nó đang thực hiện các hoạt động liên tục O(1) as it is doing constant operations

    Không gian phụ trợ: O (1): O(1)

    Bài viết này được đóng góp bởi Đan Mạch_raza. Nếu bạn thích GeekSforGeeks và muốn đóng góp, bạn cũng có thể viết một bài viết bằng Write.GeekSforGeek.org hoặc gửi bài viết của bạn. Xem bài viết của bạn xuất hiện trên trang chính của GeekSforGeek và giúp các chuyên viên máy tính khác. Xin vui lòng viết nhận xét nếu bạn tìm thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề được thảo luận ở trên. & NBSP;DANISH_RAZA . If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to . See your article appearing on the GeeksforGeeks main page and help other Geeks.
    Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.