A. ultra-fast mathematician

Source: Internet
Author: User
Time limit per test

2 seconds

Memory limit per test

256 megabytes

Input

Standard Input

Output

Standard output

Shapur was an extremely gifted student. He was great at everything including Combinatorics, algebra, number theory, geometry, Calculus, etc. He was not only smart but extraordinarily fast! He cocould manage to sum 1018 numbers
In a single second.

One day in 230 ad shapur was trying to find out if any one can possibly do calculations faster than him. as a result he made a very great contest and asked every one to come and take part.

In his contest he gave the contestants limit different pairs of numbers. Each number is made from digits 0 or 1.
The contestants shocould write a new number corresponding to the given pair of numbers. The rule is simple:I-Th digit of the answer is 1 if
And only ifI-Th digit of the two given numbers differ. In the other caseI-Th
Digit of the answer is 0.

Shapur made extends numbers and first tried his own speed. He saw that he can perform these operations on numbers of length ∞ (length of a number is number
Of digits in it) in a glance! He always gives correct answers so he expects the contestants to give correct answers, too. he is a good fellow so he won't give anyone very big numbers and he always gives one person numbers of same length.

Now you are going to take part in shapur's contest. See if you are faster and more accurate.

Input

There are two lines in each input. Each of them contains a single number. it is guaranteed that the numbers are made from 0and 1 only
And that their length is same. The numbers may start with 0. The length of each number doesn't exceed 100.

Output

Write one line-the corresponding answer. Do not omit the leading 0 s.

Sample test (s) Input
10101000100101
Output
1110001
Input
000111
Output
111
Input
11101010
Output
0100
Input
0111001100
Output
00010

Explanation: this is actually an exclusive or operation. The difference is 1, and the same is 0.

#include <iostream>#include<cstdio>#include<cstring>#include<cmath>using namespace std;int main(){char a[102];char b[102];char c[102];int k,i;scanf("%s",&a);scanf("%s",&b);k=strlen(a);for(i=0;i<k;i++){if(a[i]!=b[i]){c[i]='1';}else{c[i]='0';}}c[k]='\0';printf("%s\n",c);return 0;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.