Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt;
- var
- a:array[1..20] of longint;
- i,n,c:longint;
- function stpNum(x:longint):boolean;
- var
- tmp:string;
- i,n,c:longint;
- begin
- str(x,tmp);
- n:=length(tmp);
- if n=1 then stpNum:=false
- else
- begin
- c:=1;
- for i:=1 to n-1 do
- if tmp[i]<=tmp[i+1] then inc(c);
- if c=n then stpNum:=true
- else stpNum:=false;
- end;
- end;
- procedure solve();
- begin
- for i:=1 to n do
- begin
- read(a[i]);
- if stpNum(a[i]) then inc(c);
- end;
- readln();
- end;
- begin
- clrscr();
- readln(n);
- solve();
- writeln(c);
- readln();
- end.
Advertisement
Add Comment
Please, Sign In to add comment