Viết chương trình nhập vào mảng A
Tìm đoạn con của mảng A có m phần tử( m nhập từ bàn phím, m nhỏ hơn hoặc bằng số phần tử mảng A) sao cho có tổng các phần tử nhỏ nhất. In ra đoạn con đó
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.
bước 1: nhập n
bước 2: đổi n ra chuỗi bằng cách dùng hàm str(n,st);
bước 3: d:=length(st); t:=0;
bước 4: chạy for i từ 1 tới d
bước 5: đổi st[i] ra số bằng cách sử dụng hàm val(st[i],x,y);
bước 6: t:=t+x;
bước 7 nếu t chia hết cho d thì viết (n,' la so dep')
không thì viết (n,' khong la so dep');
bước 8:kết thúc
câu 1:
bước 1: nhập n
bước 2: đổi n ra chuỗi st bằng cách sử dụng hàm str(n,st)
bước 3: d:=length(st);t:=0;
bước 4: chạy for i đi từ 1 tới d
bước 5: đổi st[i] ra số bằng cách sử dụng hàm val(st[i],x,y);
bước 6: t:=t+x;
bước 7: viết t ra màn hình
bước 8: kết thúc
câu 2:
bước 1: nhập n
bước 2: t:=0;
bước 3: quét for i đi từ 1 tới n
bước 4: nếu n chia hết cho i thì t:=t+i;
bước 5: viết t ra màn hình
bước 6: kết thúc
Những hành vi của học sinh là vi phạm pháp luật trong xã hội tin học hoá là :
- Những hành vi của học sinh là vi phạm pháp luật trong xã hội tin học hoá là :
câu 1:
-bước 1: nhập n
-bước 2: t:=0; chạy for từ 1 tới n div 2
-bước 3: nếu n chia hết cho i thì t:=t+i;
-bước 4: nếu t=n thì viết(n,' la so hoan hao');
-bước 5: kết thúc
câu 2:
-bước 1: nhập n
-bước 2: đổi n ra st bằng cách dùng hàm str(n,st);
-bước 3: d:=length(st);
-bước 4: chạy for từ d xuống 1
-bước 5: viết st[i];
-bước 6: kết thúc
Mình học pascal bạn ơi, thế này khó hiểu quá