alex326

Untitled

Jan 22nd, 2018
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. problema 2214
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int x,y,z,a,c1=0,c2=0,c3=0;
  8. cin>>x>>y;
  9. z=x;
  10. a=y;
  11. while ((x!=0) or (y!=0)){
  12. if (x!=0)
  13. c1++;
  14. if (y!=0)
  15. c2++;
  16. x=x/10;
  17. y=y/10;
  18. }
  19. if (c1==c2)
  20. cout<<"DA"<<endl;
  21. else if (c1!=c2){
  22. cout<<"NU"<<endl;
  23. return 0;
  24. }
  25. while (z!=0){
  26. if (z%10==a%10)
  27. c3+=1;
  28. z=z/10;
  29. a=a/10;
  30. }
  31. cout<<c3;
  32. }
Add Comment
Please, Sign In to add comment