Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  mot cai ten
Language: PASCAL
Code:
const nmax=100;
type boiso=array[1..nmax] of longint;
var k,n,s,i:longint;
    a:boiso;
begin
readln(n);
readln(k);
s:=0;
for i:=1 to n do
  writeln('nhap vao phan tu thu ',i);
  readln(a[i]);
for i:=1 to n do
 if a[i] mod k = 0 then 
   s:=s+a[i];
writeln('tong la',s);
readln;
end.
  
          
Comments: