Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;// ||sau
- int main() {
- unsigned n,ok=1,uc=0,puc=0,nrcif=0;
- cout<<"n=";cin>>n;
- int cn=n;
- while (cn!=0) {
- nrcif++;
- cn/=10;
- }
- while (nrcif!=1&&ok==1) {
- uc=n%10;
- puc=(n/10)%10;
- if (puc!=uc)
- ok=0;
- n/=10;
- nrcif--;
- }
- if (ok)
- cout<<"DA";
- else
- cout<<"NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement