Những câu hỏi liên quan
Tuân Trần
Xem chi tiết
Nguyễn Lê Phước Thịnh
28 tháng 2 2021 lúc 10:24

uses crt;

var i,n:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do

  writeln(i,'. XIN CHAO');

readln;

end.

Bình luận (0)
Diệu Anh Trần
Xem chi tiết
Vũ Quang Huy
12 tháng 3 2022 lúc 9:37

tham khảo

Program Hotboy;

 

Uses crt;

 

Var A:array[1..100] of integer;

 

I,n : byte;

 

S:real;

 

Begin

 

Clrscr ;

 

S:=1;

 

Write('nhao so phan tu trong day'); 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 5 =0 then 

S:=S* A[i] ; 

 

Writeln('Tong cac phan tu chia het cho 5 trong mang la',S); 

 

Readln

 

End.

Bình luận (0)
Nguyễn Lê Phước Thịnh
14 tháng 3 2022 lúc 15:56

uses crt;

var a:array[1..100]of integer;

i,n,t:integer;

begin

clrscr;

readln(n);

t:=1;

for i:=1 to n do 

  if a[i] mod 2<>0 then t:=t*a[i];

writeln(t);

readln;

end.

Bình luận (0)
2k15
Xem chi tiết
Gia Huy
1 tháng 7 2023 lúc 7:11

```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;

}
```

Bình luận (0)
Yết Thiên
Xem chi tiết
nguyễn an phát
12 tháng 5 2021 lúc 14:48
program tinh_tong;

uses crt;

var i,n:integer;

t:longint;

a:array[1..100]of integer;

begin

clrscr;

write('nhap n:');readln(n);

t:=0;

for i:=1 to n do

begin

write('a[',i,']=');readln(a[i]);

if a[i] mod 2=0 then t:=t+a[i];

end;

write(t);

readln;

end.

  
Bình luận (0)
Lê Thị Thùy Dung
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 2 2022 lúc 0:09

Bài 1: 

#include <bits/stdc++.h>

using namespace std;

long long i,n,x,t;

int main()

{

cin>>n;

t=0;

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

{

cin>>x;

if (x%15==0) t=t+x;

}

cout<<t;

return 0;

}

Bình luận (0)
Nguyễn Trường An
Xem chi tiết
lê thị bích ngọc
19 tháng 11 2021 lúc 16:36

bạn hỏi khó thế, đây mới là phần cho lớp 8 thôi mà

Bình luận (0)
Quỳnh
Xem chi tiết
Minh Lệ
29 tháng 4 2021 lúc 14:33

Program HOC24;

var a: array[1..32000] of integer;

i,n,d: integer;

begin

write('Nhap N: ');

for i:=1 to n do

begin

write('A[',i,']='); readln(a[i]);

end;

write('Day vua nhap la: '); 

for i:=1 to n do write(a[i],' '); writeln;

d:=0;

for i:=1 to n do if a[i]>0 then d:=d+1;

write('Co ',d,' so duong');

readln

end.

Bình luận (0)
Hiep Ho
Xem chi tiết
Anh Nguyen
Xem chi tiết
Phía sau một cô gái
18 tháng 3 2023 lúc 19:37

N = int(input("Nhập số lượng phần tử của dãy N (>50): "))

while N <= 50:

         N = int(input("Nhập lại số lượng phần tử của dãy N (>50): "))

# Nhập vào dãy số 

danh_sach = []

for i in range(N):

         danh_sach.append(int(input("Nhập số thứ %d: " % (i+1))))

# In ra dãy số vừa nhập

print("Dãy số vừa nhập:")

for i in danh_sach:

         print(i, end=' ')

# Nhập vào số nguyên x

x = int(input("nNhập vào số nguyên x: "))

# In ra các số chia hết cho x 

print("Các số chia hết cho x là:")

for i in danh_sach:

         if i % x == 0:

                  print(i, end=' ')

Bình luận (0)