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 tim_n;
uses crt;
var tong,n,i:word;
begin
clrscr;
n:=1;tong:=0;
while tong<500 do
begin
for i:=1 to n do tong:=tong+i;
if tong<500 then begin tong:=0;n:=n+1;end
else n:=n-1;
end;
write('so n thoa man dieu kien la:',n);
readln;
end.
uses crt;
var i,n,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
t:=0;
for i:=1 to 500 do
begin
t:=t+i;
if t>500 then
begin
writeln(i);
break;
end;
end;
readln;
end.
uses crt;
var n,i,t:integer;
begin
n:=0;
t:=0;
repeat
n:=n+2;
t:=t+n;
until t>69;
writeln(n);
writeln(t);
readln;
end.
Uses crt;
var
begin clrscr;
k:=1;
s:=0;
while (s<700) do begin
k:=k+1
s:=s+k;
end;
writeln(s,' ',k);
readln;
end;
1:
#include <bits/stdc++.h>
using namespace std;
long long dem,i,n,x;
int main()
{
cin>>n;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0) dem++;
}
cout<<dem;
return 0;
}
Câu 2:
#include <bits/stdc++.h>
using namespace std;
long long x,n,i,t;
int main()
{
cin>>n;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%3==0) t+=x;
}
cout<<t;
return 0;
}
uses crt;
var n:string;
i,ln,nn,t,s,x,y:integer;
begin
clrscr;
readln(n);
writeln(length(n));
ln:=0;
nn:=9;
for i:=1 to length(n) do
begin
val(n[i],x,y);
if ln<x then ln:=x;
if nn>x then nn:=x;
end;
writeln(ln);
writeln(nn);
t:=0;
s:=1;
for i:=1 to length(n) do
begin
val(n[i],x,y);
t:=t+x;
s:=s*x;
end;
writeln(t);
writeln(s);
readln;
end.
Var n,s:integer;
Begin
n:=0;
While s<=1000 do
begin
n:=n+1;
s:=s+n;
End;
Write('Tong dau tien lon hon 1000 la ',s);
Readln;
End.
Tham khảo link: https://hoc24.vn/cau-hoi/viet-chuong-trinh-tinh-tong-cua-n-so-tu-nhien-dau-tien-sao-cho-tong-nho-hon-hoac-bang-1000giup-minh-voi-thu-6-thi-roi.180444032537
uses crt;
var t,n:integer;
begin
clrscr;
t:=0;
n:=0;
while t<=10 do
begin
n:=n+1;
t:=t+n;
end;
writeln(t);
readln;
end.