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.
1.uses crt;
var n,gt:longint;
begin
clrscr;
repeat
write('nhap so n:');readln(n);
until n>0;
gt:=1;
while n>0 do
begin
gt:=gt*n;
n:=n-1;
end;
writeln('giai thua cua n la:',gt);
readln
end.
2. uses crt;
var a,b,c:real;
begin
clrscr;
write('nhap a=');readln(a);
write('nhap b=');readln(b);
write('nhap c=');readln(c);
if (a*a=b*b+c*c) or (b*=c*c+a*a) or (c*c=a*a+b*b) then writeln('khong phai la tam giac vuong');
readln
end.
1:
uses crt;
const fi='ketqua.txt';
var f1:text;
st:string;
i,d:integer;
begin
clrscr;
assign(f1,fi); rewrite(f1);
write('Nhap xau:'); readln(st);
d:=length(st);
for i:=1 to d do
if st[i]=#32 then delete(st,i,1);
writeln(f1,st);
close(f1);
end.
2:
uses crt;
var a,b,c,d:integer;
{----------chuong-trinh-con-----------------------}
function min(x,y:integer):integer;
begin
if x<y then min:=x
else min:=y;
end;
{---------------chuong-trinh-chinh--------------------}
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
write('d='); readln(d);
writeln(min(a,min(b,min(c,d))));
readln;
end.
Chương trình:
program bai_10_chuong_4;
uses crt;
var
s: string[100];
i, dem: integer;
Begin
clrscr;
write('Nhap xau vao:'); readln(s); dem:= 0;
for i:= 1 to length(s) do
if ('0'<=s[i]) and(s[i]<=’9') then dem:=dem+l;
Writeln('Trong xau s co '»dem,' chu so thap phan');
readln;
End.
uses crt;
var st:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
dem:=0;
for i:=1 to d do
if st[i] in ['0'..'9'] then inc(dem);
writeln(dem);
readln;
end.
TK:
uses crt;
var n: longint;
begin
clrscr;
readln(n);
if n mod 2 = 0 then writeln('Chan') else writeln('Le');
readln;
end.
#include<bits/stdc++.h>
using namespace std;
long long N;
int main()
{
cin>>N;
if(N%2==0) cout<<N<<" là số chẵn";
if(N%2!=0) cout<<N<<" là số lẻ";
}
#include <bits/stdc++.h>
using namespace std;
long long n,k;
int main()
{
cin>>n>>k;
if (n%k==0) cout<<"Yes";
else cout<<"No";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
cin>>n;
if (n%5==0) cout<<"co";
else cout<<"ko co";
}