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.
program SMAX;
const
MAXN = 10000000;
var
n, i: longint;
a: int64;
curSum, maxSum: int64;
f: text;
begin
assign(f, 'SMAX.INP');
reset(f);
readln(f, n);
curSum := 0;
maxSum := -1000000000000000000; { rất nhỏ }
for i := 1 to n do
begin
read(f, a);
if curSum + a > a then
curSum := curSum + a
else
curSum := a;
if curSum > maxSum then
maxSum := curSum;
end;
close(f);
assign(f, 'SMAX.OUT');
rewrite(f);
writeln(f, maxSum);
close(f);
end.
def xoa_phan_tu_chia_het_cho_3(arr):
return [x for x in arr if x % 3 != 0]
# Nhập số phần tử của dãy
n = int(input())
# Nhập dãy số nguyên
day_so = list(map(int, input().split()))
# Xóa các phần tử chia hết cho 3
ket_qua = xoa_phan_tu_chia_het_cho_3(day_so)
# In ra dãy sau khi xóa
print(*ket_qua)
#include <bits/stdc++.h>
using namespace std;
string n;
int d,i,t,x;
int main()
{
freopen("tong.inp","r",stdin);
freopen("tong.out","w",stdout);
cin>>st;
d=st.length();
t=0;
for (i=0; i<=d; i++)
{
x=int(st[i])-48;
t=t+x;
}
cout<<t;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a[10000],i,n,t;
int main()
{
freopen("avg.inp","r",stdin);
freopen("avg.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
t=0;
for (i=1; i<=n; i++) t+=a[i];
cout<<fixed<<setprecision(1)<<(t*1.0)/(n*1.0);
return 0;
}