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;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln(t);
readln;
end.
Câu 2:
uses crt;
var a:array[1..100]of integer;
i,n,x,dem,kt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap x='); readln(x);
kt:=0;
dem:=0;
for i:=1 to n do
if a[i]=x then
begin
kt:=1;
write(i:4);
inc(dem);
end;
if kt=0 then writeln('Khong co ',x,' trong day');
writeln(x,' xuat hien ',dem,' lan trong day');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
bool kt;
int n,i;
int main()
{
cin>>n;
kt=true;
for (i=2; i*i<=n; i++)
if (n%i==0) kt=false;
if ((kt==true) and (n>1)) cout<<"YES";
else cout<<"NO";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long n,m;
//chuongtrinhcon
long long tcs(long long n)
{
long long t=0;
for (i=1; i<=n-1; i++)
if (n%i==0) t=t+i;
return(t);
}
//chuongtrinhchinh
int main()
{
cin>>n>>m;
if ((tcs(n)==m) and (tcs(m)==n)) cout<<"Yes";
else cout<<"No";
}
uses crt;
var a:integer;
begin
clrscr;
readln(a);
if (a mod 3=0) or (a mod 5=0) then write('co')
else writeln('khong');
readln;
end.
Câu 1:
uses crt;
var a,b:integer;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
if (a>0) and (b>0) then writeln('Cung duong');
if (a<0) and (b<0) then writeln('Cung am');
if (a>0) and (b<0) then writeln('Duong am');
if (a<0) and (b>0) then writeln('Am duong');
readln;
end.
Câu 2:
uses crt;
var a,b:integer;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
if (a mod 2=0) and (b mod 2=0) then writeln('Cung chan');
if (a mod 2<>0) and (b mod 2<>0) then writeln('Cung le');
if (a mod 2=0) and (b mod 2<>0) then writeln('Chan le');
if (a mod 2<>0) and (b mod 2=0) then writeln('Le chan');
readln;
end.
program max_min;
uses crt;
var i,n,max,min:integer;
a:array[1..100]of integer;
begin
clrscr;
write('nhap n:');readln(n);
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
end;
writeln('day vua nhap la:');
for i:=1 to n do
write(a[i]:3);
writeln;
max:=a[1];min:=a[1];
for i:=1 to n do
begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
end;
writeln('gia tri lon nhat: ',max,' gia tri nho nhat: ',min);
readln;
end.
uses crt;
var a:array[1..1000000] of longint;
n,i,max,min:longint;
begin
clrscr;
write('Nhap so luong phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
end;
write('Day so vua nhap: ');
for i:=1 to n do write(a[i],' '); writeln;
max:=a[1];min:=a[1];
for i:=2 to n do
begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
end;
writeln('GTLN: ',max);
writeln('GTNN: ',min);
readln;
end.
1:
#include <bits/stdc++.h>
using namespace std;
long long x;
int main()
{
cin>>x;
if (x%5==0) cout<<"Yes";
else cout<<"No";
return 0;
}
2:
#include <bits/stdc++.h>
using namespace std;
long long x;
int main()
{
cin>>x;
if (x%15==0) cout<<"Yes";
else cout<<"No";
return 0;
}
Câu 58:
Var n:integer;
Begin
Write('n = ');readln(n);
If n mod 2 <> 0 then write(n,' la so le')
Else write(n,' khong la so le');
Readln
End.
Câu 61:
Var n:integer;
Begin
Write('n = ');readln(n);
If n mod 2 = 0 then write(n,' la so chan')
Else write(n,' khong la so chan');
Readln
End.