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)
uses crt;
var i,y:integer;
begin
clrscr;
y:=0;
for i:=1 to 100 do
y:=y+i;
writeln('y=',y);
readln;
end.
c)
uses crt;
var y,i:integer;
begin
clrscr;
y:=0;
i:=1;
while y<=3200 do
begin
y:=y+i;
inc(i);
end;
writeln('y=',y);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double s,a;
int i,n;
int main()
{
cin>>a;
s=0;
n=0;
while (s<=a)
{
n=n+1;
s=s+1/(n*1.0);
}
cout<<n;
return 0;
}
program kitu;
uses crt;
var i,j,k:integer;
s1,s2:string;
begin
clrscr;
write('nhap xau:')readln(s1);
s2:='';
for i:=1 to length(s1) do
if (s1[i]>='1')and(s1[i]<='9')then s2:=s2+21[i];
for i = 1 to 4
k:=i;
for j:=i to length(s)+i-4 do
if s2[k]<s2[j] then k:=j;
if k>i then delete(s,i,k-i);
end;
writeln(copy(s,1,4));
readln;
end.
uses crt;
var i,n:integer;
s:real;
begin
clrscr;
n:=1;
s:=0;
while (n<=10000) do
begin
n:=n+2;
s:=s+1/n;
end;
writeln(s:4:2);
readln;
end.
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;
}
a) uses crt;
var n,x,i:longint;
lt:real;
begin
clrscr;
write('Nhap co so n=');readln(n);
write('Nhap so mu x='); readln(x);
lt:=1;
for i:=1 to x do
lt:=lt*n;
writeln(n,'^',x,'=',lt:0:0);
readln;
end.