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 3:
Var i,n:integer:
Begin
Write('n = ');readln(n);
Write('Cac uoc cua n la ');
For i:=1 to n do
If n mod i = 0 then write(i:8);
Readln
End.
Câu 4
Var i,n:integer:
Begin
Write('n = ');readln(n);
Write('Cac so le nho hon n la ');
For i:=1 to n - 1 do
If i mod 2 <> 0 then write(i:8);
Readln
End.
a) Ban đầu đề A là số còn B là xâu sao trong yêu cầu lại đổi vị trí cho nhau vậy nhỉ?
b) Xâu thay thế cái gì bạn, hình như đề còn thiếu bạn kiểm tra lại nhé.
2:
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<a%b<<endl;
cout<<a/b;
return 0;
}
b:
#include <bits/stdc++.h>
using namespace std;
long long a,b,t;
int main()
{
cin>>a>>b;
t=a+b;
cout<<t;
return 0;
}
Câu 1:
uses crt;
var a,s,p:real;
begin
clrscr;
repeat
write('Nhap do dai canh hinh vuong:'); readln(a);
until a>0;
p:=4*a;
s:=sqr(a);
writeln('Chu vi hinh vuong la: ',p:4:2);
writeln('Dien tich hinh vuong la: ',s);
readln;
end.
Câu 2:
uses crt;
var a,b,t,s,h:real;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
t:=a+b;
h:=a-b;
s:=a*b;
writeln('Tong la: ',t:4:2);
writeln('Hieu la: ',h:4:2);
writeln('Tich la: ',s:4:2);
readln;
end.
Câu 3:
uses crt;
var a,b,c:real;
begin
clrscr;
repeat
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
write('Nhap c='); readln(c);
until (a>0) and (b>0) and (c>0);
if (a+b>c) and (a+c>b) and (b+c>a) then writeln('Day la ba canh trong mot tam giac')
else writeln('Day khong la ba canh trong mot tam giac');
readln;
end.
#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";
}
Bài 3:
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<a%b;
cout<<a/b;
return 0;
}
b:
#include <bits/stdc++.h>
using namespace std;
long long a,b,t;
int main()
{
cin>>a>>b;
t=a+b;
cout<<t;
return 0;
}
1,
program so_nguyen;
uses crt;
var a,b:real;
begin
writeln('Nhap so thu nhat');,readln(a);
writeln('Nhap so thu hai');readln(b);
If (a>0) and (b>0) then writeln('cung dau') else write('khong cung dau');
If (a<0) and (b<0) then writeln('cung dau') else write('khong cung dau');
2,, program so_nguyen;
uses crt;
var a,b:real;
begin
writeln('Nhap so thu nhat');,readln(a);
writeln('Nhap so thu hai');readln(b);
If a>b then write('so thu nhat lon hon');
If a<b then write('so thu hai lon hon');
readln
end.(Pascal nha) - Có thể dùng If...then... hoặc while...do...