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.
uses crt;
var x,y:integer;
begin
clrscr;
write('Nhap x='); readln(x);
write('Nhap y='); readln(y);
if x>y then writeln(x-y)
else writeln(x+y);
readln;
end.
uses crt;
var x,y:integer;
begin
clrscr;
write('Nhap x='); readln(x);
write('Nhap y='); readln(y);
writeln(x+y);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double x;
int main()
{
cin>>x;
if (x>0) cout<<"X la so duong";
else cout<<"X la so am";
return 0;
}
Bài 2:
#include <bits/stdc++.h>;
using namespace std;
int main();
{
long m,n;
cout<<"Nhap m="; cin>>m;
cout<<"Nhap n="; cin>>n;
cout<<m*n-2;
return 0;
}
Bài 1:
uses crt;
var a:array[1..200]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
if a[i] mod 5=0 then t:=t+a[i];
writeln('Tong cac so chia het cho 5 la: ',t);
readln;
end.
Bài 2:
uses crt;
var st:string;
d,i:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
for i:=1 to d do
if st[i]=#32 then delete(st,i,1);
writeln(st);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int A[500],n,i,dem,dem1;
int main()
{
cin>>n;
for (int i=1; i<=n; i++) cin>>A[i];
for (int i=n; i>=1; i--) cout<<A[i]<<" ";
cout<<endl;
dem=0;
for (int i=1; i<=n; i++)
if (A[i]<10) dem++;
cout<<dem<<endl;
dem1=0;
for (int i=1; i<=n; i++)
if (A[i]>1)
{
bool kt=true;
for (int j=2; j*j<=A[i]; j++)
if (A[i]%j==0) kt=false;
if (kt==true) dem1++;
}
cout<<dem1;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main() {
double x, y;
cin >> x;
if(x<0) {cout << "Khong co y thoa man bieu thuc tren";}
if(x>=0)
{y=cbrt(x)+sqrt(x)+1;
cout << y << endl;}
return 0;
}
Chúc bn học tốt!
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;
for i:=1 to n do
write(a[i]:4);
writeln;
t:=0;
for i:=1 to n do
if a[i] mod 7=0 then t:=t+a[i];
writeln('Tong cac so chia het cho 7 la: ',t);
readln;
end.
uses crt;
var x,y:integer;
begin
clrscr;
write('Nhap x='); readln(x);
write('Nhap y='); readln(y);
if x>y then writeln(x-y)
else writeln(x+y);
readln;
end.