@eocron
Кактус
66 / 66 / 6
Регистрация: 23.05.2012
Сообщений: 343
|
29.05.2013, 23:26
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| #include <iostream>
using namespace std;
int Maxx(int b)
{
if(b == 0){ return 0; }
int a = abs(b);
int max = -1;
while(a>0)
{
if(a%10 > max)
{
max = a%10;
}
a/=10;
}
return max;
}
int main()
{
cout<<Maxx(-2477945)<<endl;
cin.get();
} |
|
0
|