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<iostream>
using namespace std;
int main() {
int n, tram, chuc, donvi;
cout<<"Nhap vao mot so co 3 chu so: ";
cin>>n;
tram = n / 100;
chuc = (n%100) / 10;
donvi = (n%100) % 10;
cout<<"Chu so hang tram cua so "<<n<<" la: "<<tram<<endl;
cout<<"Chu so hang chuc cua so "<<n<<" la: "<<chuc<<endl;
cout<<"Chu so hang don vi cua so "<<n<<" la: "<<donvi<<endl;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll a;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>a;
cout<<a/100<<"\n"<<(a/10)%10<<"\n"<<a%10;
}
out tu đúng
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;
int a;
int main()
{
cin>>a;
cout<<a%10<<" "<<a/10;
}
#include <iostream>
using namespace std;
int main() {
int num;
cout << "Nhap vao mot so nguyen co 2 chu so: ";
cin >> num;
int hang_chuc = num / 10;
int hang_don_vi = num % 10;
cout << "Chu so hang chuc: " << hang_chuc << endl;
cout << "Chu so hang don vi: " << hang_don_vi << endl;
return 0;
}
VD: 2,4,6
- số hàng trăm là 2
- số hàng chục là 4
-số hàng đơn vị là 6
- Tổng các chữ số:2+4+6=12
GIÚP MK VS MK ĐANG CẦN GẤP!!!
tham khảo https://hayhochoi.vn/cach-tinh-theo-phuong-trinh-hoa-hoc-va-bai-tap-van-dung-hoa-8-bai-22.html
Bài 1:
uses crt;
var a,b,c:real;
kt:boolean;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
if (a>0) and (b>0) and (c>0) then
begin
if (a+b>c) and (a+c>b) and (b+c>a) then
begin
kt:=false;
if sqr(a)=sqr(b)+sqr(c) then kt:=true;
if sqr(b)=sqr(a)+sqr(c) then kt:=true;
if sqr(c)=sqr(a)+sqr(b) then kt:=true;
if kt=false then writeln('day khong la ba canh trong mot tam giac vuong')
else writeln('day la ba canh trong mot tam giac vuong');
end
else writeln('day khong la ba canh trong mot tam giac');
end
else writeln('vui long nhap ba so duong');
readln;
end.
Bài 2:
uses crt;
var n,i:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
if (n mod i=0) and (i mod 2=0) then write(i:4);
readln;
end.
Bài 3:
uses crt;
var n,i,j:integer;
begin
clrscr;
write('n='); readln(n);
for i:=2 to n do
begin
writeln('bang cuu chuong ',i,' la: ');
for j:=1 to 10 do
write(j*i,' ');
writeln;
end;
readln;
end.
Bài 4:
uses crt;
var n,i:integer;
begin
clrscr;
write('n='); readln(n);
if n>0 then
begin
for i:=0 to n do
if i mod 2=1 then write(i:4);
end
else writeln('vui long nhap n la so nguyen duong');
readln;
end.
Bài 5:
uses crt;
var a,b,c,d,max:integer;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
write('d='); readln(d);
max:=a;
if max<b then max:=b;
if max<c then max:=c;
if max<d then max:=d;
writeln('so lon nhat la: ',max);
readln;
end.
Câu 1:
uses crt;
var a,b,c,d,min:longint;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
write('d='); readln(d);
min:=a;
if min>b then min:=b;
if min>c then min:=c;
if min>d then min:=d;
writeln('so nho nhat la: ',min);
readln;
end.
Câu 2:
uses crt;
var a,b,c:real;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
if (a>0) and (b>0) and (c>0) then
begin
if (a+b>c) and (a+c>b) and (b+c>a) then
begin
if (a=b) and (b=c) then writeln('day la 3 canh trong mot tam giac deu')
else writeln('day khong la 3 canh trong mot tam giac deu');
end
else writeln('day khong la 3 canh trong mot tam giac');
end
else writeln('vui long nhap 3 so duong');
readln;
end.
Câu 3:
uses crt;
var a,dv,ch,tr:longint;
begin
clrscr;
write('a='); readln(a);
if (a>=100) and (a<=999) then
begin
dv:=a mod 10;
ch:=a div 10; ch:=ch mod 10;
tr:=a div 100; tr:=tr mod 10;
writeln('chu so hang tram: ',tr);
writeln('chu so hang chuc: ',ch);
writeln('chu so hang don vi: ',dv);
end
else writeln('vui long nhap so co ba chu so');
readln;
end.
Câu 4:
uses crt;
var a,s:longint;
begin
clrscr;
s:=1;
write('so thu 1:'); readln(a);
s:=s*a;
write('so thu 2:'); readln(a);
s:=s*a;
write('so thu 3:'); readln(a);
s:=s*a;
write('so thu 4:'); readln(a);
s:=s*a;
writeln('trung binh nhan cua 4 so la: ',s/4:4:2);
readln;
end.
Câu 5:
uses crt;
var a,s:longint;
begin
clrscr;
s:=0;
write('so thu 1:'); readln(a);
s:=s+a;
write('so thu 2:'); readln(a);
s:=s+a;
write('so thu 3:'); readln(a);
s:=s+a;
write('so thu 4:'); readln(a);
s:=s+a;
writeln('trung binh cong cua 4 so la: ',s/4:4:2);
readln;
end.