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.
Lời giải :
program hotrotinhoc;
var a: array[1..32000] of integer ;
i,n,tong : integer ;
begin
write('n='); readln(n);
for i:= 1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
tong:=0;
for i:= 1 to n do
if a[i] mod 2 <> 0 then tong:=tong+a[i];
write('Tong cac so le la :',tong);
readln
end.
#include <bits/stdc++.h>
using namespace std;
long long m,n,x,y;
int main()
{
cin>>m>>n>>x>>y;
cout<<min(m,min(n,min(x,y)));
return 0;
}
1.
var n:longint;
begin
write('Nhap n = ');
read(n);
if n mod 2=0 then writeln('n chia het cho 2')
else writeln('n khong chia het cho 2');
end.
2. (Bài này làm mảng dễ hơn nha)
var a,b,c:longint;
begin
read(a,b,c);
if (a>=b) and (b>=c) then writeln(c,' ',b,' ',a)
else if (a>=b) and (a>=c) then writeln(b,' ',c,' ',a)
else if (a>=b) then writeln(b,' ',a,' ',c)
else if (a>=c) then writeln(c,' ',a,' ',b)
else if (b>=c) then writeln(a,' ',c,' ',b)
else writeln(a,' ',b,' ',c);
end.
3.
var i,n,tong:longint;
begin
write('Nhap n = ');
read(n);
for i:=1 to n do
tong:=tong+i;
write(tong);
end.
program bai12;
uses crt;
var
begin
clrcr;
write('Nhap mot so N= ');readln(n);
if n>10 then writeln(n,'>10');
if n<10 then writeln(n,'<10');
readln
end.
câu 1)ar i,max,maxnhi,n:integer;
a:array[1..100] of integer;
begin
repeat
write('n=');readln(n);
until (n>1) and (n<40)
for i:=1 to n do begin
write('So thu ',i,': ');readln(a[i]);
end;
max:=a[1];
for i:=2 to n do
if a[i] > max then max:=a[i];
maxnhi:=a[1];
for i:=1 to n do
if (a[i]>maxnhi) and (a[i]<max) then maxnhi:=a[i];
write(' So lon thu 2 la: ',maxnhi);
readln;
end.
var a,b,c,d,e,f,m,l,i,dem,n:longint;
s:real; st:ansistring;
begin
write('Nhap so nguyen a: ');readln(a);
write('Nhap so nguyen b: ');readln(b);
if a>b then begin
if a mod 2014=0 then write('YES') else write('NO'); end;
if b>a then begin
if b mod 2014=0 then write('YES') else write('NO'); end;
readln;
end.
1)
var n: integer ;
write('nhap gia tri n'); readln(n);
for 1 to n do
if i mod 2 =1 then write(i:3);
readln
end.
uses crt;
var m,n:integer;
begin
clrscr;
readln(m,n);
if m<n then write('m nho hon n')
else if m>n then write('m lon hon n')
else write('m bang n');
readln;
end.