Nhập độ dài mảnh để lưu điểm hs, nhập mảng điểm xuất mảng điểm
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.
uses crt;
var a:array[1..14]of real;
i,n:integer;
t:real;
begin
clrscr;
write('Nhap so mon hoc='); readln(n);
for i:=1 to n do
begin
repeat
write('A[',i,']='); readln(a[i]);
until (0<=a[i]) and (a[i]<=10);
end;
for i:=1 to n do
write(a[i]:4:2,' ');
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('Diem trung binh mon la: ',t/n:4:2);
if t>=5 then writeln('Duoc len lop')
else writeln('Thi lai');
readln;
end.
uses crt;
var a:array[1..100]of integer;
n,i,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
if a[i] mod 2<>0 then t:=t+a[i];
writeln(t);
readln;
end.
1:
#include <bits/stdc++h>
using namespace std;
string a,b;
int main()
{
getline(cin,a);
getline(cin,b);
cout<<a<<" "<<b;
return 0;
}
Tham khảo
uses crt;
var diem: array[1..100] of real;
i,n: integer;
begin
clrscr;
write ('Nhap do dai mang diem: '); readln (n);
for i:=1 to n do
begin
write ('Nhap diem cua hoc sinh thu ',i,': '); readln (diem[i]);
end;
writeln ('Xuat mang diem: ');
for i:=1 to n do writeln ('Diem cua hoc sinh thu ',i,': ',diem[i]:1:2);
readln;
end.