Created
September 29, 2013 13:37
-
-
Save nikoncode/6752584 to your computer and use it in GitHub Desktop.
Task for Dasha #2_2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main () { | |
| int num1, num2, cur_num1, cur_num2, temp=1, res=0; | |
| scanf("%d %d",&num1, &num2); | |
| while (num1 % 10 != 0) { | |
| cur_num1 = num1 % 10; | |
| cur_num2 = num2 % 10; | |
| if (cur_num1 % 2 != 0 | cur_num1 != cur_num2) { | |
| res += cur_num1 * temp; | |
| temp *= 10; | |
| } | |
| num1 /= 10; | |
| num2 /= 10; | |
| } | |
| printf("%d", res); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment