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 2:
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
if (n>0 && n%5==0) cout<<"Phai";
else cout<<"Khong phai";
}
Cau 1:
Câu 2:
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
if (n>0 && n%5==0) cout<<"Phai";
else cout<<"Khong phai";
}
Bài 2:
#include <bits/stdc++.h>
using namespace std;
long long x,y;
int main()
{
cin >>x>>y;
cout<<x<<" "<<y;
swap(x,y);
cout<<x<<" "<<y;
return 0;
}
program mang;
uses crt;
var n,i,chan, le,max,min: Integer;
a:array[1..100] of integer;
begin
write('nhap so phan tu ');read(n);
for i:=1 to n do
begin
write('nhap so thu ',i); readln(a[i]);
end;
max:=a[1]; min:=a[1]; chan:=0;le:=0;
for i:=1to n do
begin
if a[i] > max then max:=a[i];
if a[i] < min then min:=a[i];
if a[i] mod 2 = 0 then chan:=chan+1
else le:=le+1;
end;
writeln('max la: ',max);
writeln('min la: ',min);
writeln('so phan tu chan: ',chan);
writeln('so phan tu le: ',le);
readln
end.
Var i,n:integer;
p:longint;
Begin
Write('Nhap n = ');readln(n);
p:=0;
For i:=2 to n do p:=p*i;
Write('Tich la ',p);
Readln;
End.
Var i,n:integer;
p:longint;
Begin
Write('Nhap n = ');readln(n);
p:=1;
For i:=2 to n do p:=p*i;
Write('Tich la ',p);
Readln;
End.
2)
Var x,y: integer;
Begin
Write('Nhap x: '); readln(x);
Write('Nhap y: '); readln(y);
If x=y then writeln('Khong the thuc hien yeu cau');
If x>y then writeln('Sap xep theo gia tri tang dan: ',y,',',x);
If x<y then writeln('Sap xep theo gia tri tang dan: ',x,',',y);
Readln;
End.
chỉ cần bạn cố gắng học tin và làm bài tập thật nhiều là bạn sẽ giỏi thôi
bài 1:
uses crt;
var a,b:integer;
begin
clrscr;
write('nhap a='); readln(a);
write('nhap b='); readln(b);
if a>b then writeln('so lon nhat trong hai so ',a,' va ',b,' la: ',a);
if a<b then writeln('so lon nhat trong hai so ',a,' va ',b,' la: ',b);
if a=b then writeln('khong co so lon nhat trong hai so ',a,' va ',b);
readln;
end.
bài 2:
uses crt;
var a,b:integer;
begin
clrscr;
repeat
write('a='); readln(a);
write('b='); readln(b);
if a=b then writeln('ban da nhap sai, yeu cau ban nhap lai');
until a<>b;
if a>b then writeln(a,' ',b);
if a<b then writeln(b,' ',a);
readln;
end.