K
Khách

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.

const fi='songuyen.inp';

fo='tong.out';

var f1,f2:text;

a:array[1..100]of integer;

n,i,dem:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

n:=0;

while not eof(f1) do 

  begin

n:=n+1;

read(f1,a[n]);

end;

dem:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then inc(dem);

writeln(f2,dem);

close(f1);

close(f2);

end.

const fi='songuyen.inp';

fo='tong.out';

var f1,f2:text;

a:array[1..100]of integer;

i,n,t:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

n:=0;

while not eoln(f1) do 

  begin

n:=n+1;

read(f1,a[n]);

end;

t:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then t:=t+a[i];

writeln(f2,t);

close(f1);

close(f2);

end.

const fi='bai1.inp';

fo='bai1.out';

var f1,f2:text;

a:array[1..100]of integer;

n,i,t,dem:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,n);

for i:=1 to n do 

  read(f1,a[i]);

t:=0;

dem:=0;

for i:=1 to n do 

  begin

if a[i] mod 2<>0 then t:=t+a[i]

else inc(dem);

end;

writeln(f2,'Tong cac so le la: ',t);

writeln(f2,'So so chan la: ',dem);

close(f1);

close(f2);

end.

uses crt;

const fi='songuyen.inp';

var f1:text;

a:array[1..100]of integer;

i,n,t:integer;

begin

clrscr;

assign(f1,fi); reset(f1);

n:=0;

while not eoln(f1) do 

  begin

n:=n+1;

read(f1,a[n]);

end;

t:=0;

for i:=1 to n do 

 if a[i] mod 2=0 then t:=t+a[i];

writeln(t);

readln;

end.

const fi='input.txt';

fo='chiahet.txt';

var f1,f2:text;

a:array[1..100]of integer;

i,n,dem:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

n:=0;

while not eoln(f1) do 

begin

inc(n);

read(f1,a[n]);

end;

dem:=0;

for i:=1 to n do

if a[i] mod 3=0 then inc(dem);

writeln(f2,dem);

close(f1);

close(f2);

end.

#include <bits/stdc++.h>

using namespace std;

long long a[1000],i,n,dem;

int main()

{

freopen("dl.inp","r",stdin);

freopen("dl.dat","w",stdout);

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

dem=0;

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

if (a[i]==10) dem++;

cout<<dem;

return 0;

}