yoyoboyss

Untitled

May 11th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream.h>
  2.  
  3. void main(){
  4. int n, i, nr, pr, ul;
  5. int v[100000];
  6.  
  7. cout << "n= "; cin >> n;
  8. for(i = 0; i < n; i++){
  9. cout << "v[" << i << "]= ";
  10. cin >> v[i];
  11. nr = v[i];
  12. ul = nr % 10;
  13. while(nr != 0){
  14. if(nr < 10)
  15. pr = nr;
  16. nr /= 10;
  17. }
  18. if(pr == ul)
  19. cout << v[i] << "\n";
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment