K
Khách

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.

8 tháng 10 2019

program hoidaptinhoc;
uses crt;
var K,N,X,Y,M,i : longint;
z : string;
BEGIN
clrscr;
writeln('Nhap so dong trong moi trang cua quyen sach: '); readln(K);
writeln('Nhap so thu tu cua dong: '); readln(N);
if (N mod K) = 0 then begin X:=N div K; Y:=K end;
if (N mod K) <> 0 then begin X:= (N div K) + 1; Y:=N mod K end;
M:=0;
for i:=1 to X do
begin
str(i,z);
M:=M+length(z);
end;
writeln('X= ',X,' Y= ',Y);
writeln('M= ',M);
readln;
END.

12 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long n,i,x,t,dem,j;

int main()

{

cin>>n;

x=n;

t=0;

while (n>0)

{

t=t+n%10;

n=n/10;

}

cout<<t;

dem=0;

for (i=2; i<=x; i++)

{

bool kt=true;

for (j=2; j*j<=i; j++)

if (i%j==0) kt=false;

if (kt==true) dem++;

}

cout<<dem;

return 0;

}

D
datcoder
CTVVIP
22 tháng 1

Program HOC24;

var x: integer;

begin

write('Nhap so: '); readln(x);

if x div 1000=1 then write('Mot nghin ');

if x div 1000=2 then write('Hai nghin ');

if x div 1000=3 then write('Ba nghin ');

if x div 1000=4 then write('Bon nghin ');

if x div 1000=5 then write('Nam nghin ');

if x div 1000=6 then write('Sau nghin ');

if x div 1000=7 then write('Bay nghin ');

if x div 1000=8 then write('Tam nghin ');

if x div 1000=9 then write('Chin nghin ');

if x div 1000<>0 then

if x div 100=0 then write('khong tram ');

if x div 100=1 then write('mot tram ');

if x div 100=2 then write('hai tram ');

if x div 100=3 then write('ba tram ');

if x div 100=4 then write('bon tram ');

if x div 100=5 then write('nam tram ');

if x div 100=6 then write('sau tram ');

if x div 100=7 then write('bay tram ');

if x div 100=8 then write('tam tram ');

if x div 100=9 then write('chin tram ');

if (x div 1000<>0) or (x div 100<>0) then

begin

if (x div 10<>0) then

begin

if x div 10=1 then write('muoi ');

if x div 10=2 then write('hai muoi ');

if x div 10=3 then write('ba muoi ');

if x div 10=4 then write('bon muoi ');

if x div 10=5 then write('nam muoi ');

if x div 10=6 then write('sau muoi ');

if x div 10=7 then write('bay muoi ');

if x div 10=8 then write('tam muoi ');

if x div 10=9 then write('chin muoi ');

if x mod 10=1 then write('mot');

if x mod 10=2 then write('hai');

if x mod 10=3 then write('ba');

if x mod 10=4 then write('bon');

if x mod 10=5 then write('lam');

if x mod 10=6 then write('sau');

if x mod 10=7 then write('bay');

if x mod 10=8 then write('tam');

if x mod 10=9 then write('chin');

end else

begin

if x mod 10=1 then write('le mot');

if x mod 10=2 then write('le hai');

if x mod 10=3 then write('le ba');

if x mod 10=4 then write('le tu');

if x mod 10=5 then write('le nam');

if x mod 10=6 then write('le sau');

if x mod 10=7 then write('le bay');

if x mod 10=8 then write('le tam');

if x mod 10=9 then write('le chin');

end;

readln

end.

#include <bits/stdc++.h>

using namespace std;

long long n,i,x,dem,a;

int main()

{

cin>>n>>x;

dem=0;

for (i=1; i<=n; i++)

{

cin>>a;

if (a==x) dem++;

}

cout<<dem;

return 0;

}

19 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

long n,i,dem,t;

int main()

{

cin>>n;

dem=0;

t=0;

for (i=1; i<=n;i++)

if (n%i==0) 

{

dem++;

t=t+i;

}

cout<<dem<<" "<<t;

return 0;

}

uses crt;

var i,n,t,j,kt:integer;

begin

clrscr;

readln(n);

t:=0;

for i:=2 to n do

if n mod i=0 then

begin

kt:=0;

for j:=2 to trunc(sqrt(i)) do

if i mod j=0 then kt:=1;

if kt=0 then t:=t+i;

end;

write(t);

readln;

end.

29 tháng 8 2023

cảm ơn bn đã giúp mik nhiều bn thông cảm

7 tháng 1 2022

Số N (0<N<10 mũ 9)

7 tháng 1 2022

N = int(input())
A = 0
B = 0
So_uoc = 0
KQ = ""
for x in range(1, N):
    if (x%2==0) and (x%3==0):
        A += 1
    if (x>0) and (N%x==0):
        if (x>B):
            B = x
for i in range(1, N+1):
    if (N%i==0):
        So_uoc += 1
if (So_uoc == 2):
    KQ = "YES"
else:
    KQ = "NO"
print(A)
print(B)
print(len(str(N)))
print(KQ)

(Chẳng biết đúng không đâu bucminh)

#include <bits/stdc++.h>

using namespace std;

long long a,b;

char st;

int main()

{

cin>>a>>b;

cout<<"Nhap phep tinh:"; cin>>st;

if (st=='+') cout<<a+b;

if (st=='-') cout<<a-b;

if (st=='*') cout<<a*b;

if (st=='/') cout<<a/b;

return 0;

}

23 tháng 1 2022

minh tap lap trinh pascal ma du sao cung cam mon ban da co long tot

1 tháng 7 2023

```cpp
#include <iostream>
#include <vector>
#include <algorithm>

int main() {
int n;
std::cout << "Enter the number of integers (n < 10^5): ";
std::cin >> n;

std::vector&lt;int&gt; numbers(n); std::cout &lt;&lt; &quot;Enter &quot; &lt;&lt; n &lt;&lt; &quot; integers: &quot;; for (int i = 0; i &lt; n; ++i) { std::cin &gt;&gt; numbers[i]; } int sumOfOdd = 0; for (int i = 0; i &lt; n; ++i) { if (numbers[i] % 2 != 0) { sumOfOdd += numbers[i]; } } std::sort(numbers.begin(), numbers.end()); std::cout &lt;&lt; &quot;Sum of odd integers: &quot; &lt;&lt; sumOfOdd &lt;&lt; std::endl; std::cout &lt;&lt; &quot;Sorted sequence: &quot;; for (int i = 0; i &lt; n; ++i) { std::cout &lt;&lt; numbers[i] &lt;&lt; &quot; &quot;; } std::cout &lt;&lt; std::endl; return 0;

}
```