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 p,a,b:integer;
begin
clrscr;
readln(p)
a:=p div 60;
b:=p mod 60;
write(a,':',b);
readln;
end.
uses crt;
var x,y,z:real;
begin
clrscr;
write('Nhap x='); readln(x);
write('Nhap y='); readln(y);
z:=abs(1-sqr(x))+abs(1-sqr(y));
writeln('Z=',z:4:2);
readln;
end.
tham khảo
Program Hotboy;
Uses crt;
Var A:array[1..100] of integer;
I,n : byte;
S:real;
Begin
Clrscr ;
S:=1;
Write('nhao so phan tu trong day'); readln(n);
For i:=1 to n do
Begin
Write('A[',i,']'); readln(A[i]);
End;
For i:=1 to n do
If A[i] mod 5 =0 then
S:=S* A[i] ;
Writeln('Tong cac phan tu chia het cho 5 trong mang la',S);
Readln
End.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
readln(n);
t:=1;
for i:=1 to n do
if a[i] mod 2<>0 then t:=t*a[i];
writeln(t);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int p;
int main()
{
cin>>p;
cout<<p/60<<":"<<p%60;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
float a,b,c,tbc;
cout<<"a="; cin>>a;
cout<<"b="; cin>>b;
cout<<"c="; cin>>c;
tbc=(a+b+c)/3;
cout<<fixed<setprecision(1)<<tbc;
return 0;
}
Bài 1:
uses crt;
var a:array[1..100]of integer;
i,n,kt,max,x,j,tam:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Mang ban vua nhap la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
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;
writeln('Day tang dan la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
write('Nhap x='); readln(x);
max:=0;
kt:=0;
for i:=1 to n do
if (a[i] mod 2=0) and (a[i]<=x) then
begin
if max<a[i] then max:=a[i];
kt:=1;
end;
if kt=0 then writeln('Trong day khong co so le')
else writeln('So chan lon nhat khong vuot qua ',x,' la: ',max);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,a[1000];
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
sort(a+1,a+n+1);
for (i=n; i>=1; i--) cout<<a[i]<<" ";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long i,n,x;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
{
cin>>x;
if (x==0) cout<<i<<" ";
}
return 0;
}
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll i, j, n, a[1000005], dem = 0, m;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
for (i = 1; i <= n; i++)
{
cin >> a[i];
if (a[i] % 3 == 0)
{
n--;
i--;
}
}
for (i = 1; i <= n; i++)
{
cout << a[i] << " ";
}
cout<<endl;
for(i=1;i<=n;i++)
{
if(a[i]%5==0)
{
for(j=i;j<=n;j++)
{
a[j]=a[j+1];
}
n--;
i--;
}
}
for(i=1;i<=n;i++)
{
cout<<a[i]<<" ";
}
return 0;
}