Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a,b,a1,b1,n,S1,S2;
- int main()
- {
- cin>>a>>b;
- S1=S2=0;
- a1=a;
- b1=b;
- while(a!=0)
- {
- S1=S1+1;
- a=a/10;
- }
- while(b!=0)
- {
- S2=S2+1;
- b=b/10;
- }
- if(S1!=S2)
- {
- cout<<"NU";
- }
- else
- {
- while(a1!=0 && b1!=0)
- {
- if(a1%10==b1%10)
- {
- n++;
- }
- a1=a1/10;
- b1=b1/10;
- }
- cout <<"DA"<<endl<<n;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement