Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- /*
- unsigned c=0,x=0,nr=0;
- cout<<"x=";cin>>x;
- cout<<"c=";cin>>c;
- while (x!=0) {
- if (x%10==c)
- nr++;
- x/=10;
- }
- cout<<"c apare in x de "<<nr<<" ori";
- //*/
- //2
- /*
- unsigned c=0,x=0,cifmmari=1;
- cout<<"x=";cin>>x;
- cout<<"c=";cin>>c;
- while (x!=0) {
- if (x%10<=c)
- cifmmari=0;
- x/=10;
- }
- if (cifmmari==1)
- cout<<"DA";
- else
- cout<<"NU";
- //*/
- //3
- //*/
- //5
- /*
- unsigned x,inv=0;
- cout<<"x=";cin>>x;
- while (x!=0) {
- inv=inv*10+x%10;
- x/=10;
- }
- cout<<"inv="<<inv;
- //*/
- //6
- /*
- unsigned x,inv=0,cx;
- cout<<"x=";cin>>x;
- cx=x;
- while (x!=0) {
- inv=inv*10+x%10;
- x/=10;
- }
- if (cx==inv)
- cout<<"nr e palindrom";
- else
- cout<<"nr nu e palindrom";
- //*/
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement