Lucian_Adrian

#56 NumararePerechi

Oct 5th, 2021
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. int x,s=0,y;
  5. cin >> x;
  6. if(x<0) x = -x;
  7. cin >> y;
  8. if(y<0)
  9. y= -y;
  10. while(y){
  11. if(x%10==y%10)
  12. s++;
  13. x = y;
  14. cin >> y;
  15. if(y<0)
  16. y= -y;
  17. }
  18. cout << s << endl;
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment