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.
-so sanh hai so nhap tu ban phim:
var a,b:integer;
begin
clrscr;
write('Nhap so thu nhat:');readln(a);
write('Nhap so thu hai:');readln(b);
if a>b then writeln(a,'lon hon',b)
else writeln(a,'nho hon,'b);
if a=b then writeln(a,'bang',b);
readln;
end.
program ctdt;
uses crt;
type mang=array[1..10]of integer;
var a,b,min,x,y,i,j,tam:integer;
t,t1:mang;
(*------------------------*)
BEGIN
clrscr;
(*cau a*)
write('nhap 2 so:');readln(a,b);
if a>b then writeln(a,' lon hon ',b);
if a=b then writeln(a,' bang ',b);
if a<b then writeln(a,' nho thua ,b);
(*cau b*)
for i:=1 to 4 do {dua 4 so vao 1 mang}
begin
write(so thu ',i,' :');readln(t[i]);
end;
min:=t[1];
for i:=2 to 4 do
if t[i]<min then min:=t[i];
writeln('so nho nhat trong bon so:',min);
(*cau c*)
write('nhap hai so x,y:');readln(x,y);
if x>y then
begin
tam:=x;
x:=y;
y:=tam;
end;
(*cau d*)
for i:=1 to 3 do {dua 3 so vao mot mang}
begin
write(' so thu ',i,': ');readln(t1[i]);
end;
for i:=1 to 3-1 do
for j:=i+1 to 3 do
if t1[j]>t1[i] then
begin
tam:=t1[j];
t1[j]:=t1[i];
t1[i]:=tam;
end;
for i:=1 to 3 do
write(t1[i]);
readln;
end.
bai nay con vai loi sai nho
ban nen chay tung cau mot va khoa cac cau con lai bang lenh {...}
Câu 2:
Program nii;
Uses crt;
Var a,b,c,A:integer;
Begin
Write ('nhap a');
Readln (a);
Write ('nhap b');
Readln (b);
Write ('nhap c');
Readln (c);
A:=a;
If A<b then A:=b;
If A<c then A:=c;
Write ('Ket qua',A);
Readln;
End.
Câu 1
Program ntg;
Uses crt;
Var A,x,y:integer;
Begin
Write ('nhap x');
Readln (x);
Write ('nhap y');
Readln ('y');
A:=x+y;
Write ('Ket qua',A);
Readln;
End.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,t=0;
cin>>n;
for (int i=1; i<=n; i++)
if (i%6==0) t+=i;
cout<<t;
return 0;
}
uses crt;
var k,x,y:integer;
begin
clrscr;
readln(k);
x:=k mod 5;
y:=k div 5;
writeln(k,'/5=',x,' du ',y);
readln;
end.
uses crt;
var n,x:integer;
begin
clrscr;
write('Nhap n='); readln(n);
writeln('n=',n);
x:=n;
if x mod 2=0 then writeln(x,' la so chan')
else writeln(x,' la so le');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,t;
int main()
{
cin>>n;
t=0;
for (i=1; i<=n; i++)
if (i%2==0) t+=i;
cout<<t;
return 0;
}
5)
program bai1;
var a,b:longint;
begin
write('Nhap so nguyen thu nhat ');readln(a);
write('Nhap so nguyen thu hai');readln(b);
if a=b then writeln('Hai so bang nhau')
else if a<b then writeln(a,'<',b)
else writeln(a,'>',b);
readln
end.
1)
writeln('Nhap so a= ');readln(a);
writeln('(a+b)*2= ',(a+b)*2);
a:=1;
b:=2;