SHOW:
|
|
- or go back to the newest paste.
1 | int number_backup; | |
2 | int next_digit; | |
3 | int total_counter = 0; | |
4 | int current_counter; | |
5 | int i; | |
6 | - | for (int i = 0; i <=9 ; i++) |
6 | + | |
7 | for (i = 0; i <=9 ; i++) | |
8 | - | int number_backup = number; |
8 | + | |
9 | number_backup = number; | |
10 | current_counter = 0; | |
11 | ||
12 | while (number_backup > 0) | |
13 | { | |
14 | next_digit = number_backup % 10; | |
15 | number_backup = number_backup / 10; | |
16 | ||
17 | if (i == next_digit) | |
18 | - | current_counter++' |
18 | + | |
19 | current_counter++ף | |
20 | } | |
21 | } | |
22 | ||
23 | if (current_counter > 1) | |
24 | { | |
25 | total_counter += current_counter; | |
26 | } | |
27 | } | |
28 | ||
29 | printf("%d",total_counter); |