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.
Tham Khảo:
uses crt;
var ngay:integer;
lp:string;
begin
clrscr;
repeat
write('nhap so ngay thue phong khach san:'); readln(ngay);
if ngay<=0 then writeln('nhap lai');
until ngay>0;
repeat
write('nhap loai phong:'); readln(lp);
if (lp<>'A') and (lp<>'B') and (lp<>'C') then writeln('nhap lai');
until (lp='A') or (lp='B') or (lp='C');
case lp of
'A': write(300000*ngay);
'B': write(250000*ngay);
'C': write(200000*ngay);
end;
readln;
end.
uses crt;
var ngay:integer;
lp:string;
begin
clrscr;
repeat
write('nhap so ngay thue phong khach san:'); readln(ngay);
if ngay<=0 then writeln('nhap lai');
until ngay>0;
repeat
write('nhap loai phong:'); readln(lp);
if (lp<>'A') and (lp<>'B') and (lp<>'C') then writeln('nhap lai');
until (lp='A') or (lp='B') or (lp='C');
case lp of
'A': write(300000*ngay);
'B': write(250000*ngay);
'C': write(200000*ngay);
end;
readln;
end.
cô gì đó ơi sao cô lại giải cho bạn bài vòng lặp trong khi đó bài này chỉ ở bài 6 thui mà
Bài 1:
#include <bits/stdc++.h>
using namespace std;
double a,b,cv,dt;
int main()
{
cin>>a>>b;
cv=(a+b)/2;
dt=a*b;
cout<<"Chu vi la:"<<fixed<<setprecision(2)<<cv<<endl;
cout<<"Dien tich la:"<<fixed<<setprecision(2)<<dt;
return 0;
}
Câu 1:
uses crt;
var a,b:integer;
begin
clrscr;
readln(a,b);
writeln((a+b)/2:4:2);
readln;
end.
Var n:integer;
Begin
Write (' nhap so tien : ');
Readln(n);
Write ( n div 50,' to 50n ');
n:=n mod 50;
Write ( n div 20,' to 20n ');
n:=n mod 20;
Write ( n div 5,' to 5n ');
n:=n mod 5;
Write ( n div 2,' to 2n ');
n:=n mod 2;
Write ( n div 1,' to 1n ');
n:=n mod 1;
Readln;
end.
program b1;
uses crt;
var i,n,dat,chuadat:integer;
a:array[1..100] of integer;
begin
clrscr;
write('Nhap tong so ban trong lop:');
readln(n);
for i:=1 to n do readln(a[i]);
dat:=0; chuadat:=0;
for i:=1 to n do
begin
if (a[i]>=5) then inc(dat);
if (5>=a[i]) then inc(chuadat);
end;
writeln('So hoc sinh dat la:',dat);
writeln('So hoc sinh chuadat la:',chuadat);
readln;
end.
Tham khao!
#include <bits/stdc++.h>
using namespace std;
long long a,b,c;
int main()
{
cin>>a>>b>>c;
cout<<a+b+c<<endl;
cout<<a*b*c;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a,b,c;
int main()
{
cin>>a>>b>>c;
cout<<a+b+c<<endl;
cout<<a*b*c;
return 0;
}