Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (2017, 8 iunie, sesiunea specială)
- 3. #include<iostream>
- using namespace std;
- int egale(int a)
- {
- int u=a%10;
- while(a!=0)
- {
- if(a%10!=u)
- {
- return 0;
- }
- a=a/10;
- }
- return 1;
- }
- void identice(int a, int b)
- {
- int i, ok=0;
- for(i=a; i<=b; i++)
- {
- if(egale(i)==1)
- {
- cout<<i<<" ";
- ok=1;
- }
- }
- if(ok==0)
- {
- cout<<"nu exista";
- }
- }
- int main()
- {
- int a, b;
- cin>>a>>b;
- identice(a, b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement