Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n,a,b;
- bool ok=true;
- cin >> n;
- a=n%10;
- while(n!=0){
- b=n%10;
- n=n/10;
- if(b!=a){
- ok=false;
- break;
- }
- }
- if(ok==true) cout<<1;
- else cout<<0;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement