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 x,y:integer;

//chuongtrinhcon

function tong(a,b:integer):integer;

begin

tong:=a+b;

end;

//chuongtrinhchinh

begin

clrscr;

readln(x,y);

writeln(tong(x,y));

readln;

end.

uses crt;

var x,y:integer;

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

function tong(a,b:integer):integer;

begin

tong:=a+b;

end;

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

funtion hieu(a,b:integer):integer;

begin

hieu:=a-b;

end;

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

function tich(a,b:integer):integer;

begin

tich:=a*b;

end;

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

function thuong(a,b:integer):real;

begin

thuong:=a/b;

end;

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

begin

clrscr;

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

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

writeln('Tong la: ',tong(x,y));

writeln('Hieu la: ',hieu(x,y));

writeln('Tich la: ',tich(x,y));

writeln('Thuong la: ',thuong(x,y):4:2);

readln;

end.

13 tháng 6 2023

c++:

#include <iostream>

using namespace std;

int main(){

int y;

cin >> y;

int i = 1;

int luythua = 1;

while(i<=y){

luythua = luythua *i;

i = i+1;

}

cout << luythua;

}

#include <bits/stdc++.h>

using namespace std;

long long n,i,x,t;

int main()

{

cin>>n;

t=0;

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

{

cin>>x;

if (x<0) t+=x;

}

cout<<t;

return 0;

}

uses crt;

var a,b,c,d:integer;

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

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

begin

if x<y then max:=y

else max:=x;

end;

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

begin

clrscr;

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

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

write('c='); readln(c);

write('d='); readln(d);

writeln(max(a,max(b,max(c,d))));

readln;

end.

uses crt;

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

i,n,t:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

t:=0;

for i:=1 to n do 

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

writeln(t);

readln;

end.