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.

1:

uses crt;

const fi='ketqua.txt';

var f1:text;

st:string;

i,d:integer;

begin

clrscr;

assign(f1,fi); rewrite(f1);

write('Nhap xau:'); readln(st);

d:=length(st);

for i:=1 to d do 

 if st[i]=#32 then delete(st,i,1);

writeln(f1,st);

close(f1);

end.

2:

uses crt;

var a,b,c,d:integer;

{----------chuong-trinh-con-----------------------}

function min(x,y:integer):integer;

begin

if x<y then min:=x

else min:=y;

end;

{---------------chuong-trinh-chinh--------------------}

begin

clrscr;

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

write('d='); readln(d);

writeln(min(a,min(b,min(c,d))));

readln;

end.

25 tháng 7 2021

cau 1:

uses crt;

var a:array[1..100] of integer;

n,i,min: integer;

begin

readln(n);

for i:=1 to n do

readln(a[i]);

min:=a[1];

for i:=2 to n do

if min>a[i] then min=a[i];

writeln(a[i]);

readln;

end.

cau 2:

uses crt;

g:text;

s:string;

const fo='CHUSO.TXT';

begin

assign(g,fo);

rewrite(g);

readln(s);

for i:=1 to length(s) do

if not((s[i] in ['a'..'z'])and(s[i] in ['A'..'Z])) then delete(s,i,1);

writeln(g,s);

end.

Bài 3: 

uses crt;

const fi='teptong.txt';

var a,b:integer;

f1:text;

begin

clrscr;

assign(f1,fi); rewrite(f1);

readln(a,b);

writeln(a+b);

writeln(f1,a+b);

close(f1);

readln;

end.

uses crt;

const fi='max.out';

var f1:text;

a,b,c,max:integer;

begin

clrscr;

assign(f1,fi); rewrite(f1);

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

max:=a;

if max<b then max:=b;

if max<c then max:=c;

writeln(f1,max);

close(f1);

readln;

end.

20 tháng 5 2021

Program HOC24;

var a: array[1..32000] of integer;

ucln,i,n,ucln1: integer;

function uc(x,y: integer): integer;

var tg: integer;

begin

while y<>0 do

begin

tg:=x mod y;

x:=y;

y:=tg;

end;

uc:=x;

end;

begin

write('Nhap N: '); readln(n);

for i:=1 to n do

begin

write('A[',i,']='); readln(a[i]);

end;

ucln1:=uc(a[1],a[2]);

for i:=3 to n do ucln:=uc(ucln1,a[i]);

write('Uoc chung lon nhat cua day so la: ',ucln);

readln

end.

uses crt;

var a:array[1..100]of integer;

n,i,k,dem,dem1:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

write('Nhap k='); readln(k);

dem:=0;

dem1:=0;

for i:=1 to n do 

  begin

if a[i] mod 2=0 then inc(dem);

if a[i] mod k=0 then inc(dem1);

end;

writeln('So phan tu chan la: ',dem);

writeln('So phan tu chia het cho ',k,' la: ',dem1);

readln;

end.

#include <bits/stdc++.h>

using namespace std;

long long x,y;

int main()

{

cin>>x>>y;

freopen("kq.txt","w",stdout);

cout<<x+y<<endl;

cout<<x-y<<endl;

cout<<x*y<<endl;

cout<<fixed<<setprecision(2)<<(x*1.0)/(y*1.0);

return 0;

}