K
Khách

Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.

12 tháng 7 2020

Program HOC24;

const fi='nhap.inp';

fo='nhap.out';

var f: text;

t,code,min,max,i,j: integer;

a: array[1..1000] of string;

b: array[1..1000] of integer;

s: string;

procedure ip;

begin

assign(f,fi);

reset(f);

readln(f,s);

for i:=1 to length(s) do

if not(s[i] in ['0'..'9']) then s[i]:=' ';

while s[1]=#32 do delete(s,1,1);

while pos(#32#32,s)<>0 do delete(s,pos(#32#32,s),1);

while s[length(s)]=#32 do delete(s,length(s),1);

close(f);

end;

procedure out;

begin

assign(f,fo);

rewrite(f);

s:=s+' '; j:=0;

while length(s)<>0 do

begin

j:=j+1;

a[j]:=copy(s,1,pos(#32,s)-1);

delete(s,1,pos(#32,s));

end;

for i:=1 to j do

if a[i][1]='0' then delete(a[i],1,1);

for i:=1 to j do

begin

val(a[i],t,code);

b[i]:=t;

end;

min:=b[1]; max:=0;

for i:=1 to j do

begin

if min>b[i] then min:=b[i];

if b[i]>max then max:=b[i];

end;

writeln(f,min);

write(f,max);

close(f);

end;

begin

ip;

out;

end.

Bạn có đọc kỹ đề không vậy?

const fi='timmax.inp';     

fo='timmax.out';

var f1,f2:text;   

st,xauso:ansistring;   

d,i,max,x:longint;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,st);

d:=length(st);

xauso:='';

max:=0;

for i:=1 to d do 

if st[i] in ['0'..'9'] then xauso:=xauso+st[i] 

else begin         

              val(xauso,x);         

              if max<=x then max:=x;         

              xauso:='';       

        end;

if max=0 then writeln(f2,'-1')

else writeln(f2,max);

close(f1);

close(f2);

end.

6 tháng 1 2024

#include <bits/stdc++.h>
using namespace std;
int main() {
    string str;
    getline(cin, str);
    string ans = "";
    for (char c : str) {
        if (!isdigit(c)) {
            ans += c;
        }
    }
    cout <<ans;
}

Theo mk là như v

uses crt;

var st:string;

d,i:integer;

begin

clrscr;

readln(st);

d:=length(st);

for i:=1 to d do

if not(st[i] in ['0'..'9']) then write(st[i]);

readln;

end.

6 tháng 3 2021

ai làm giúp mình