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;
long long n;
int main()
{
cin>>n;
if (n%9==0) cout<<"n la boi cua 9";
else cout<<"n khong la boi cua 9";
return 0;
}
var a,b:longint;
begin
write('nhap a:');readln(a);
write('nhap b:');readln(b);
cau a) if a>b then write(a);
cau b) if a=b then write('hai so bang nhau') else write('hai so ko bang nhau');
cau c) if a mod b=1 then write('a le') else write('a chan');
readln
end.
mỗi câu a,b,c thì readln rồi end nhé
Đề 1:
uses crt;
var a:array[1..100]of integer;
i,n,min:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
min:=a[1];
for i:=1 to n do
if min>a[i] then min:=a[i];
writeln(min);
readln;
end.
Đề 2:
uses crt;
var a:array[1..100]of integer;
i,n,max:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do
if a[i] mod 2=0 then write(a[i]:4);
readln;
end.
uses crt;
var a:array[1..1000000] of longint;
n,i:longint;
begin
clrscr;
write('Nhap so luong phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
end;
write('Cac so chan: ');
for i:=1 to n do if a[i] mod 2=0 then write(a[i],' ');
readln;
end.
c1:
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) s=s*i;
cout<<s;
return 0;
}
Câu 2:
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) if (i%2==0) s=s*i;
cout<<s;
return 0;
}
Câu 1:
Program HOC24;
var i,p: integer;
t: longint;
begin
write('Nhap P: '); readln(p);
t:=0;
for i:=1 to p do if i mod 2<>0 then t:=t+i;
write('Tong cac so le la: ',t);
readln
end.
program Chan_Le;
var
n, i: integer;
begin
write('Nhap vao so nguyen N: ');
readln(n);
writeln('Cac so chan tu 1 den ', n, ' la:');
for i := 2 to n do
begin
if i mod 2 = 0 then
begin
write(i, ' ');
end;
end;
writeln;
writeln('Cac so le tu 1 den ', n, ' la:');
for i := 1 to n do
begin
if i mod 2 <> 0 then
begin
write(i, ' ');
end;
end;
readln;
end.
program Chan_Le;
var n, i: integer;
begin
write('Nhap vao so nguyen n: ');
readln(n);
writeln('Cac so chan tu 1 den ',n, ' la: ');
for i := 1 to n do
begin
if i mod 2 = 0 then
write(i, ' ');
end;
writeln;
writeln('Cac so le tu 1 den ', n, ' la: ');
for i := 1 to n do
begin
if i mod 2 <> 0 then
write(i, ' ');
end;
readln;
end.
a)
uses crt;
var i,n:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n<100;
if n mod 2=0 then
begin
for i:=0 to n do
if i mod 2=0 then write(i:4);
end
else writeln(n,' khong la so chan');
readln;
end.
b)
uses crt;
var i,n:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n<100;
if n mod 2=1 then
begin
for i:=1 to n do
if i mod 2=1 then write(i:4);
end
else writeln(n,' khong la so le');
readln;
end.
Program bai_tap;
Uses crt;
Var i:integer;
Begin
clrscr;
For i:=9 to 50 writeln(i);
readln;
End.
Program bai_tap;
Uses crt;
Var i:integer;
Begin
clrscr;
For i:=9 to 50 writeln(i);
readln;
End.