03.05.2014, 14:08. Просмотров 258. Ответов 0
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| #include "stdafx.h"
#include <iostream>
#include <cstring>
#include <math.h>
using namespace std;
int Proverka (int N)
{
int a; int b; int k=0; int k1=0;
b=N% 10; N=N/10;
while (N!=0)
{ a=N%10;
N=N/10;
if (b>a)
{k=k+1;
b=a;}
k1=k1+1;
}
if (k==k1)return (1);
else return (0);
}
int main()
{
int ch;
cin>>ch;
while (ch!=0)
{cout<< Proverka(ch)<<"\n";
cin>>ch;
}
system ("pause");
return 0;
} |
|
0
|