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.

#include <bits/stdc++.h>

using namespace std;

long long a,b;

double tb;

int main()

{

freopen("dulieu.inp","r",stdin);

freopen("ketqua.out","w",stdout);

cin>>a>>b;

cout<<a<<" "<<b;

cout<<fixed<<setprecision(2)<<(a*1.0+b*1.0)/(2*1.0);

return 0;

}

#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;

}

uses crt;

const fo='b.txt';

var f1:text;

a:array[1..200]of integer;

i,n:integer;

begin

clrscr;

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

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

for i:=1 to n do

begin

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

end;

for i:=1 to n do

write(f1,a[i]:4);

close(f1);

readln;

end.

29 tháng 1 2021

program cap_so_cong; 

uses crt; var a: array[1..100] of integer; i, n, k: integer;

{i la bien dem, k de luu cap so} begin clrscr; write('N= ');

readln(n); for i:=1 to n do begin write('A(',i,')= ');

readln(a[i]);

 end; 

{Bat dau phan kiem tra} k:=a[2]-a[1]; i:=2; repeat i:= i+1; until (a[i]<>a[i-1]+k) or (i>n);

 if i>n then write('Day A la mot cap so cong') else

write('Day A khong phai la mot cap so cong');

 readln 

end. 

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.

uses crt;

const fi='so.inp';

var f1:text;

a,b:integer;

begin

clrscr;

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

while not eof(f1) do 

 begin

readln(f1,a,b);

writeln((a+b)/2:4:2);

end;

close(f1);

readln;

end.

1 tháng 12 2021

giúp em với

 

1 tháng 12 2021

Caua1:

program caumot;

begin

writeln('lop 8A chao ban!');

end.

Câu 2:

program cauhai;

int a,b,c :real;

begin

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

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

c= a+b;

write('Tong hai so a b la:',c);

end.