Răspuns :
#include
using namespace std;
int x,ok;
int main()
{
ok=1;
cin>>x;
while (x/10)
{
if (x%10< x/10%10)
ok=0;
x/=10;
}
if (ok)
cout<<"DA";
else
cout<<"NU";
}
using namespace std;
int x,ok;
int main()
{
ok=1;
cin>>x;
while (x/10)
{
if (x%10< x/10%10)
ok=0;
x/=10;
}
if (ok)
cout<<"DA";
else
cout<<"NU";
}
Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n, s,z,u;
cin >> n;
s=n/100; u=n%10; z=(n/10)%10;
if (s<=z && z<=u) {
cout << "cifrele sunt ordonate crescator";
}
else cout << "cifrele nu sunt ordonate crescator";
return 0;
}
Explicație: