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 <bits/stdc++.h>
using namespace std;
int n;
int main()
{
cin>>n;
if (n%5==0) cout<<"co";
else cout<<"ko co";
}
Program Tin_hoc;
Uses Crt;
Var N: Integer;
Begin
Write('Nhap so nguyen N');
Readln(N);
If N>0 then write(' So do la so duong ');
If N<0 then write(' So do la so am ');
If N=0 then write(' So do khong la so am va so duong');
Readln;
End.
Program Tin_hoc;
Uses Crt;
Var N: Integer;
Begin
Write('Nhap so nguyen N');
Readln(N);
If N>0 then write(' So do la so duong ');
If N<0 then write(' So do la so am ');
If N=0 then write(' So do khong la so am va so duong');
Readln;
End.
câu 1 Uses Crt;
Var St:String;
dem: Array[‘A’..’Z’] Of Byte
; i:Byte;
ch:Char;
Begin Write(‘Nhap xau St: ‘);
Readln(St);
{Khởi tạo mảng} For ch:=’A’ To ‘Z’ Do dem[ch]:=0;
{Duyệt xâu} For i:=1 To Length(St) Do If Upcase(St[i]) IN [‘A’..’Z’] Then Inc(dem[Upcase(St[i])]);
{Liệt kê các ký tự ra màn hình} For ch:=’A’ To ‘Z’ Do If dem[ch]>0 Then Writeln(ch,’ : ’,dem[ch]);
Readln;
Câu 1:
uses crt;
var st:string;
d,i,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
write('Xau sau khi xoa so la: ');
for i:=1 to d do
if not(st[i] in ['0'..'9']) then write(st[i]);
writeln;
dem:=0;
for i:=1 to d do
if st[i]=#32 then inc(dem);
writeln('Xau co ',dem,' dau cach');
writeln('Do dai cua xau la: ',d);
readln;
end.
Câu 2:
uses crt;
const fi='kq.out';
var st1,st2:string;
f1:text;
begin
clrscr;
write('Nhap xau thu 1:'); readln(st1);
write('Nhap xau thu 2:'); readln(st2);
assign(f1,fi); rewrite(f1);
if length(st2)>length(st1) then writeln(f1,st2)
else writeln(f1,st1);
close(f1);
end.
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
bool kt=true;
for (int i=2; i*i<=n; i++)
if (n%i==0) kt=false;
if (kt==true && n>=2) cout<<"YES";
else cout<<"NO";
return 0;
}
Bài 1:
uses crt;
var S:String;
vt:integer;
begin
clrscr;
Write(‘Nhap 1 xau:’); Readln(S);
While pos(‘nang’,s)>0 do
Begin
Vt:= pos(‘nang’,s);
Delete(s,vt,4);
Insert(‘mua’,s ,vt);
End;
Writeln(‘Xau sau khi thay the ’,s);
Readln;
End.
Bài 2:
uses crt;
var st:string;
d,i,kt:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
kt:=0;
for i:=1 to d do
if st[i]<>st[d-i+1] then kt:=1;
if kt=0 then writeln(st,' la xau doi xung')
else writeln(st,' khong la xau doi xung');
readln;
end.
Bài 3:
uses crt;
const fi='teptong.txt';
var a,b:integer;
f1:text;
begin
clrscr;
assign(f1,fi); rewrite(f1);
readln(a,b);
writeln(a+b);
writeln(f1,a+b);
close(f1);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double a,b;
int main()
{
cin>>a>>b;
if (a+b>10) cout<<"YES";
else cout<<"NO";
return 0;
}