Răspuns:
.
Explicație:
1.
#include <fstream>
#include <iostream>
using namespace std;
ifstream f("date.in");
int main ()
{
int n, cmax = 0, c;
f >> n;
while ( n > 0 )
{
c = n % 10;
If ( c > cmax )
cmax = c;
n = n / 10;
}
If ( cmax % 2 == 0 )
cout << "DA";
else
cout << "NU";
return 0;
}
2.
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("date.in");
int main ()
{
int n, ok = 1;
f >> n;
while ( ok == 1 )
{
if ( n % 10 == 0 || n % 10 == 5 )
cout << n, ok = 0;
else
n = n + 1;
}
return 0;
}
dacă ai nelămuriri spune