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.
program bai1;
var
begin
write('Ten cua ban la ');readln(ten);
write('Nam hien tai la ');readln(nht);
write('Nhap nam sinh ');readln(ns);
write('Ban hoc lop ');readln(lop);
tuoi:=nht-ns;
writeln('Ten cua ban la ',tuoi);
readln
end.
#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.
#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;
}