Những câu hỏi liên quan
HN
Xem chi tiết
NT
21 tháng 3 2021 lúc 22:23

uses crt;

var i,n,t:integer;

begin

clrscr;

write('Nhap n='); readln(n);

i:=1;

t:=0;

while i<=n do 

begin

if i mod 2=0 then t:=t+i;

i:=i+1;

end;

write(t);

readln;

end.

Bình luận (0)
NH
Xem chi tiết
H9
15 tháng 3 2023 lúc 5:50

Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do if( i mod 2<>0) then write(i:3);

readln;

end.

 

Bình luận (0)
LA
19 tháng 3 2023 lúc 20:25

uses crt;

var i,n:longint;

begin 

writeln('nhap n'); readln(n);

for i:=1 to n do if i mod 2 =1 then 

writeln(i);

readln;

end.

ngu ththế mà cũng ko làm được về lớp 1 mà học

Bình luận (0)
KC
Xem chi tiết
NN
15 tháng 3 2023 lúc 9:26

Bình luận (0)
HD
Xem chi tiết
NT
11 tháng 4 2020 lúc 21:12

uses crt;

var s,i,n:integer;

begin

clrscr;

write('nhap n='); readln(n);

s:=0; i:=1;

while i<=n do

begin

s:=s+i;

i:=i+2;

end;

writeln(s);

readln;

end.

Bình luận (0)
MT
Xem chi tiết
NT
26 tháng 5 2020 lúc 21:38

1:

uses crt;

var i,t:integer;

s:real;

begin

clrscr;

i:=0; t:=0; s:=1;

while i<=10 do

begin

i:=i+1;

t:=t+i;

s:=s*i;

end;

writeln('Tong cua 10 so tu nhien dau tien la: ',t);

writeln('Tich cua 10 so tu nhien dau tien la: ',s:0:0);

readln;

end.

2:

uses crt;

var i:byte;

begin

clrscr;

for i:=1 to 10 do

write(i:4);

readln;

end.

Bình luận (0)
BT
Xem chi tiết
NT
6 tháng 4 2022 lúc 23:03

 

 

#include <bits/stdc++.h>

using namespace std;

long long n,i,t;

int main()

{

cin>>n;

t=0;

for (i=1; i<=n; i++)

if (i%2!=0) t+=i;

cout<<t;

return 0;

}

 

Bình luận (0)
ND
Xem chi tiết
PG
7 tháng 3 2023 lúc 20:40

program tong_100_so_tu_nhien;

uses crt;

var i, S: integer;

begin

      S := 0;

      for i := 1 to 100 do

            S := S + i;

      writeln('Tong cua 100 so tu nhien dau tien la ', S);

      readln;

end.

 

 

  
Bình luận (0)
KL
7 tháng 3 2023 lúc 21:11

Var i,s:integer;

Begin

i:=1;

s:=0;

While i<=100 do

Begin

s:=s+i;

i:=i+1;

End;

Write('Tong la ',s);

Readln;

End.

Bình luận (0)
H24
Xem chi tiết
NM
Xem chi tiết
NT
12 tháng 4 2021 lúc 23:02

uses crt;

var s,i:integer;

begin

clrscr;

s:=0;

i:=11;

while i<=101 do

  begin

s:=s+i;

i:=i+2;

end;

writeln(s);

readln;

end.

Bình luận (0)
H24
13 tháng 4 2021 lúc 15:47

*Cách làm:*

Bình luận (2)