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 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 fi='kq.txt';

var a:array[1..15]of real;

i,n:integer;

f1:text;

begin

clrscr;

n:=15;

for i:=1 to n do readln(a[i]);

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

for i:=1 to n do 

  begin

 if (i mod 5=0) then writeln(f1)

else write(f1,a[i],' ');

end;

close(f1);

readln;

end.

uses crt;

const fi='kq.txt';

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

i,n:integer;

f1:text;

begin

clrscr;

n:=10;

for i:=1 to n do readln(a[i]);

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

for i:=1 to n do 

  begin

if (n%5<>0) then write(f1,a[i]:4);

else writeln(f1);

end;

close(f1);

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.

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.

uses crt;

const fi='kq.txt';

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

i,n,dem:integer;

f1:text;

begin

clrscr;

n:=10;

for i:=1 to n do readln(a[i]);

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

for i:=1 to n do write(f1,a[i]:4);

writeln(f1);

dem:=0;

for i:=1 to n do  if a[i]>0 then dem:=dem+1;

writeln(f1,dem);

close(f1);

readln;

end.

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.