Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- int no1,no2,flag=1,tmp1,tmp2;
- scanf("%d%d",&no1,&no2);
- int reset=no2;
- for(int i=1;no1!=0;i++)
- {
- if(flag==0)
- {
- break;
- }
- tmp1= no1 % 10;
- no1 = no1 / 10;
- for(int j=0;no2!=0;j++)
- {
- tmp2 = no2 %10;
- no2 = no2 /10;
- if(tmp1==tmp2)
- {
- flag=1;
- break;
- }
- else flag=0;
- }
- no2=reset;
- }
- if(flag==1)
- {
- printf("DA");
- }
- else if(flag==0)
- {
- printf("NE");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment