Skip to content

Instantly share code, notes, and snippets.

@nikoncode
Created September 29, 2013 13:37
Show Gist options
  • Select an option

  • Save nikoncode/6752584 to your computer and use it in GitHub Desktop.

Select an option

Save nikoncode/6752584 to your computer and use it in GitHub Desktop.
Task for Dasha #2_2
#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