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.
Câu 1:
uses crt;
const fi='bai1.inp';
var f1:text;
a,b:real;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,a,b);
writeln(a*b:4:2);
close(f1);
readln;
end.
Câu 2:
const fi='bai2.inp';
fo='bai2.out';
var f1,f2:text;
a,b:real;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b);
writeln(f2,a*b:4:2);
close(f1);
close(f2);
end.
#include <bits/stdc++.h>
using namespace std;
long long x,n,i,t,dem;
int main()
{
cin>>n;
dem=0;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0 && x>10) t+=x;
if (x%2!=0 || x<100) dem++;
}
cout<<t<<" "<<dem;
return 0;
}
1:
uses crt;
var a:array[1..100]of integer;
i,n:integer;
begin
clrscr;
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(a[i]:4);
readln;
end.
2:
uses crt;
var a:array[1..100]of integer;
i,n,j,tam:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
for i:=1 to n do
write(a[i]:4);
readln;
end.
3:
uses crt;
var x,i,max:integer;
begin
clrscr;
repeat
write('Nhap x='); readln(x);
until x>0;
max:=0;
for i:=1 to x do
if i mod 2=0 then
begin
if max<=i then max:=i;
end;
writeln('So chan lon nhat khong vuot qua ',x,' la: ',max);
readln;
end.
2:
#include <bits/stdc++.h>
using namespace std;
long long n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
if (n%i==0) cout<<i<<" ";
return 0;
}
uses crt;
var st:string;
i,d,t,x,y,kq,j,lt:integer;
begin
clrscr;
readln(st);
d:=length(st);
kq:=0;
for i:=1 to d do
begin
lt:=1;
for j:=1 to d-i do
begin
val(st[i],x,y);
lt:=lt*x;
end;
kq:=kq+x*lt;
end;
writeln(kq);
readln;
end.