Advertisement
STANAANDREY

pb1256

Nov 12th, 2018
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. /*
  8.   unsigned c=0,x=0,nr=0;
  9.   cout<<"x=";cin>>x;
  10.   cout<<"c=";cin>>c;
  11.   while (x!=0) {
  12.     if (x%10==c)
  13.         nr++;
  14.     x/=10;
  15.   }
  16. cout<<"c apare in x de "<<nr<<" ori";
  17. //*/
  18. //2
  19. /*
  20.  unsigned c=0,x=0,cifmmari=1;
  21.   cout<<"x=";cin>>x;
  22.   cout<<"c=";cin>>c;
  23.   while (x!=0) {
  24.    if (x%10<=c)
  25.        cifmmari=0;
  26.    x/=10;
  27.   }
  28. if (cifmmari==1)
  29.     cout<<"DA";
  30. else
  31.     cout<<"NU";
  32. //*/
  33. //3
  34.  
  35.  
  36.  
  37. //*/
  38. //5
  39. /*
  40. unsigned x,inv=0;
  41. cout<<"x=";cin>>x;
  42. while (x!=0) {
  43.     inv=inv*10+x%10;
  44.     x/=10;
  45. }
  46.   cout<<"inv="<<inv;
  47. //*/
  48. //6
  49. /*
  50.     unsigned x,inv=0,cx;
  51. cout<<"x=";cin>>x;
  52. cx=x;
  53. while (x!=0) {
  54.     inv=inv*10+x%10;
  55.     x/=10;
  56. }
  57.   if (cx==inv)
  58.     cout<<"nr e palindrom";
  59.     else
  60.     cout<<"nr nu e palindrom";
  61. //*/
  62.  
  63.  
  64.     return 0;
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement