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.
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 )
uses crt;
var a:array[1..100]of integer;
i,n:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do
write(a[i]:4);
writeln;
for i:=1 to n do
if (a[i]+a[i+1] mod 10=0) then
begin
writeln(a[i],' ',a[i+1]);
writeln(i,' ',i+1);
end;
readln;
end.
câu 1
Program Nguyen_to;
Var n,i:integer;
Function NT(n:integer):Boolean;
Var ok: Boolean;
i: integer;
Begin ok:=true;
for i:=2 to n-1 do if (n mod i)= 0 then ok:=ok and false;
if n < 2 then NT:=false else NT:=ok;
End;
Begin Write('Nhap n: ');
Readln(n); i:=n;
Repeat i:=i+1;
Until NT(i);
Write('So nguyen to nho nhat lon hon ',n, 'la: ',i);
Readln End.
câu 2
uses crt;
const so: set of char=['0','1','2','3','4','5','6','7','8','9'];
var a:array[1..100] of integer;
st,b:string;
c,l,i,n,j:integer;
s, Max: integer;
begin clrscr;
write('Nhap xau:');
readln(st);
l:=length(st);
i:=1;
n:=0;
repeat if (st[i] in so) then begin b:='';
repeat b:=b+st[i];
inc(i);
until (not(st[i] in so)) or (i>l);
inc(n);
val(b,a[n],c);
end;
inc(i);
until i>l;
Max:=a[1];
for i:=2 to n do If Max<A[i] Then Max:=A[i];
Writeln('Phan tu lon nhat cua mang:', Max);
readln;
end.
```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<int> numbers(n); std::cout << "Enter " << n << " integers: "; for (int i = 0; i < n; ++i) { std::cin >> numbers[i]; } int sumOfOdd = 0; for (int i = 0; i < n; ++i) { if (numbers[i] % 2 != 0) { sumOfOdd += numbers[i]; } } std::sort(numbers.begin(), numbers.end()); std::cout << "Sum of odd integers: " << sumOfOdd << std::endl; std::cout << "Sorted sequence: "; for (int i = 0; i < n; ++i) { std::cout << numbers[i] << " "; } std::cout << std::endl; return 0;
}
```
#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;
}
#include <iostream>
using namespace std;
int main()
{
int t,m,n,ucln;
cout<<"Nhap n="; cin>>n;
cout<<"Nhap m="; cin>>m;
t=m%n;
while (t!=0)
{
t=n%m;
n=m;
m=t;
}
ucln=n;
cout<<ucln;
return 0;
}
program tong_so_le;
var
n, i, a_i, tong: integer;
begin
writeln('Nhap vao so nguyen khong am n:');
readln(n);
while (n <= 0) or (n > 100) do
begin
writeln('So nguyen n phai thoa man 0 < n <= 100, vui long nhap lai:');
readln(n);
end;
writeln('Nhap vao ', n, ' so nguyen a1, a2, ..., an:','<mỗi số nguyên nhập trên một hàng>');
tong := 0; // Khởi tạo tổng bằng 0
for i := 1 to n do
begin
readln(a_i);
if i mod 2 = 1 then
tong := tong + a_i;
end;
writeln('Tong cac so tai vi tri le trong mang la: ', tong);
end.
#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;
}