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.
Uses crt;
Var i,n,k,tong:integer;
tb:real;
a:array[1..1000] of integer;
f1,f2:text;
Begin
clrscr;
Assign(f1,'SONGUYEN.inp');
Assign(f2,'SONGUYEN.out');
Reset(f1);Readln(f1,n);
For i:= 1 to n do read(f1,a[i]);
close(f1);
k:=0;tong:=0;
For i:= 1 to n do If (a[i]<0) and (Abs(a[i]) mod 2 = 1) then
Begin
inc(k);
tong:=tong+a[i];
End;
tb:=tong/n;
Rewrite(f2);
writeln(f2,tb:0:2);
Writeln(f2,k);
close(f2);
readln;
End.
Câu 2:
const fi='xauhoa.inp';
fo='xauhoa.out';
var f1,f2:text;
st,s1:string;
d,i:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,st);
d:=length(st);
s1:='';
for i:=1 to d do
if st[i] in ['A'..'Z'] then s1:=s1+st[i];
writeln(f2,s1);
writeln(f2,length(s1));
close(f1);
close(f2);
end.
3:
#include <bits/stdc++.h>
using namespace std;
double x,y;
int main()
{
cin>>x>>y;
cout<<fixed<<setprecision(2)<<sqrt(x*x+y*y);
return 0;
}
Bn ơi bn viết r chụp lên đc k ạ ? Mik k định dạng đc ý
uses crt;
var a,b,c,nn:integer;
begin
clrscr;
readln(a,b,c);
nn:=a;
if nn>b then nn:=b;
if nn>c then nn:=c;
writeln(nn);
readln;
end.
Câu 2:
uses crt;
var a:array[1..100]of integer;
i,n,t1,t2:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t1:=0;
t2:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then t1:=t1+a[i]
else t2:=t2+a[i];
end;
writeln('Tong cac so chan la: ',t1);
writeln('Tong cac so le la: ',t2);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,dem,k,a[10000];
int main()
{
cin>>n;
for (i=1; i<=n; i++)
cin>>a[i];
dem=0;
cin>>k;
for (i=1; i<=n; i++)
if (a[i]%k==0)
{
cout<<a[i]<<" ";
dem++;
}
cout<<endl;
cout<<dem;
return 0;
}
uses crt;
var a:array[1..100]of integer;
i,n,dem,tb:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
tb:=0;
dem:=0;
for i:=1 to n do
if (50<=a[i]) and (a[i]<=150) then
begin
tb:=tb+a[i];
inc(dem);
end;
writeln('Ket qua la: ',tb/dem:4:2);
readln;
end.