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.

uses crt;

var a,b:integer;

{-------------chuong-trinh-con-tinh-tong---------------------}

function tong(x,y:integer):integer;

begin

tong:=x+y;

end;

{-------------chuong-trinh-con-tinh-tich------------------}

function tich(x,y:integer):integer;

begin

tich:=x*y;

end;

{-----------------chuong-trinh-con-so-lon------------------}

function solon(x,y:integer):integer;

begin

if x>y then solon:=x

else solon:=y;

end;

{-----------------chuong-trinh-con-so-be------------------}

function sobe(x,y:integer):integer;

begin

if x<y then sobe:=x

else sobe:=y;

end;

{--------------------chuong-trinh-chinh-----------------}

begin

clrscr;

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

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

writeln('Tong la: ',tong(a,b));

writeln('Tich la: ',tich(a,b));

writeln('So lon la: ',solon(a,b));

writeln('So be la: ',sobe(a,b));

readln;

end.

#include <bits/stdc++.h>

using namespace std;

long long b[20],i,n;

int main()

{

cin>>n;

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

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

{

if ((b[i]%2!=0) or (i%2==0)) cout<<b[i]<<" ";

}

return 0;

}

5 tháng 3 2022

bạn viết rõ ra giùm mình đc kko 

5 tháng 4 2019

a)Đề kiểm tra Học kì 2 Tin học 11 có đáp án (Đề 3)

b)

 Đề kiểm tra Học kì 2 Tin học 11 có đáp án (Đề 3)

uses crt;

const fi='kiemtra.txt';

var f1:text;

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

min,n,i:integer;

{----------------chuong-trinh-con-------------------}

function nn(x,y:integer):integer;

begin

if x<y then nn:=x

else nn:=y;

end;

{-----------------chuong-trinh-chinh-----------------}

begin

clrscr;

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

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

min:=nn(a[1],a[2]);

for i:=3 to n do 

  if min>a[i] then min:=a[i];

writeln(min);

readln;

end.

Mình xin sửa lại một chút:

uses crt;

const fi='kiemtra.txt';

var f1:text;

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

min,n,i:integer;

{----------------chuong-trinh-con-------------------}

function nn(x,y:integer):integer;

begin

if x<y then nn:=x

else nn:=y;

end;

{-----------------chuong-trinh-chinh-----------------}

begin

clrscr;

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

readln(f1,n);

for i:=1 to n do 

  read(f1,a[i]);

min:=nn(a[1],a[2]);

for i:=3 to n do 

  if min>a[i] then min:=a[i];

writeln(min);

readln;

end.

uses crt;

const fi='tep.txt';

var f1:text;

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

i,n,kt,j,dem:integer;

begin

clrscr;

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

n:=0;

while not eof(f1) do 

  begin

n:=n+1;

readln(f1,a[n]);

end;

dem:=0;

for i:=1 to n do 

  if a[i]>1 then 

begin

kt:=0;

for j:=2 to a[i]-1 do 

  if a[i] mod j=0 then kt:=1;

if kt=0 then inc(dem);

end;

writeln(dem);

close(f1);

readln;

end.

3 tháng 10 2017

Đáp án đúng : B