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.
#include <bits/stdc++.h>
using namespace std;
long long a[10000],i,n;
int main()
{
freopen("bai2.inp","r",stdin);
freopen("bai2.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++)
cin>>a[i];
for (i=1; i<=n; i++)
cout<<a[i]<<" ";
return 0;
return 0;
}
Câu 3:
#include <bits/stdc++.h>
using namespace std;
long long a;
int main()
{
cin>>a;
if (a%2==0) cout<<"La so chan";
else cout<<"La so le";
return 0;
}
program bai_toan;
var
S, S1: string;
i, j, n: integer;
begin
write('Nhap xau S: ');
readln(S);
n := length(S);
for i := n downto 1 do
begin
S1 := S1 + S[i];
end;
for i := n downto 1 do
begin
if S = S1 then break;
S := S + S1[i];
end;
writeln('Xau doi xung ngan nhat la: ', S);
readln;
end.
uses crt;
const fi='abc.inp';
var a:array[1..100]of integer;
i,n,dem,j,kt,dem1,dem2:integer;
f1:text;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
dem:=0;
for i:=1 to n do
if a[i] mod 2=0 then inc(dem);
dem1:=0;
for i:=1 to n do
if a[i]>1 then
begin
kt:=0;
for j:=2 to a[i]-1 do
if a[i] mod j=0 then kt:=1;
if kt=0 then inc(dem1);
end;
dem2:=0;
for i:=1 to n do
if trunc(sqrt(a[i]))=sqrt(a[i]) then inc(dem2);
writeln('So so chan la: ',dem);
writeln('So so nguyen to la: ',dem1);
writeln('So so chinh phuong la: ',dem2);
close(f1);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b,c,d,ln;
int main()
{
cin>>a>>b>>c>>d;
ln=a;
ln=max(ln,b);
ln=max(ln,c);
ln=max(ln,d);
cout<<ln;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, d, maxabcd;
cin >> a >> b >> c >> d;
maxabcd=a;
if(maxabcd<b) maxabcd=b;
if(maxabcd<c) maxabcd=c;
if(maxabcd<d) maxabcd=d;
cout << "Max=" << maxabcd << endl;
return 0;
}
Chúc bn học tốt!
uses crt;
var st:string;
d,i:integer;
begin
clrscr;
readln(st);
d:=length(st);
for i:=1 to d do
if (st[i] in ['0'..'9']) then write(st[i]);
readln;
end.
1:
uses crt;
const fi='songuyen.int';
var f1:text;
i,n:integer;
a:array[1..1000]of integer;
begin
clrscr;
assign(f1,fi); rewrite(f1);
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do write(f1,a[i]:4);
close(f1);
readln;
end.
Program HOC24;
var a: array[1..32000] of integer;
ucln,i,n,ucln1: integer;
function uc(x,y: integer): integer;
var tg: integer;
begin
while y<>0 do
begin
tg:=x mod y;
x:=y;
y:=tg;
end;
uc:=x;
end;
begin
write('Nhap N: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
ucln1:=uc(a[1],a[2]);
for i:=3 to n do ucln:=uc(ucln1,a[i]);
write('Uoc chung lon nhat cua day so la: ',ucln);
readln
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,k,x,a[1000];
int main()
{
cin>>n>>k;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]==k)
{
cout<<"YES";
return 0;
}
cout<<"NO";
return 0;
}