void max(int vector[], int size, int &max, int &min) {
max = vector[0];
min = vector[0];
for (int i = 1; i < size; i++) {
if (max < vector[i]) {
max = vector[i];
}
if (min > vector[i]) {
min = vector[i];
}
}
}
int main() {
int vector[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int max, min;
max(vector, 10, max, min);
cout << max << " " << min;
return 0;
}
#include <iostream>
#include <stdlib.h>
using namespace std;
void calcular(int opcion, int A[][3], int v[], int a, int b, int c)
{
int i,j;
int mayor, menor;
int r[3];
for(i=0; i<3; i++)
{
r[i]=0;
for(j=0; j<3; j++)
{
switch(A[i][j])
{
case 1:
if(j==0)
A[i][j] = 3*a;
else
if(j==1)
A[i][j]= 3;
else
A[i][j] = 3*c;
break;
case 2:
if(j==0)
A[i][j] = 4*b;
else
if(j==1)
A[i][j]= 9;
#include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
void aleatorizar(int a[3][3], int v[3]) {
int i,j;
srand(time(NULL));
for (i=0; i<3; i++)
for (j=0; j<3; j++) {
a[i][j] = rand()%50;
v[i] = rand()%50;
}
}
void muestra (int a[3][3], int v[3]) {
int i,j;
for (i=0; i<3; i++) {
cout << endl;
for (j=0; j<3; j++)
cout << setw(3) << a[i][j];
cout << " " << v[i] << endl;
}
}
void producto(int a[3][3], int v[3], int y[3]) {
#include <iostream>
using namespace std;
int main()
{
int a,b,c,i;
cout<<"Ingrese el valor de (a): ";
cin>>a;
cout<<"Ingrese el valor de (b): ";
cin>>b;
cout<<"Ingrese el valor de (c): ";
cin>>c;
int A[3][3]={{3*a,3,3*c},{4*b,9,8*a},{7,5*c,2*c}};
int v[3]={8*c,1,4*b};
int p[3]={0,0,0};
for (i=0;i<3;i++)
{
p[i]=A[i][0]*v[0]+A[i][1]*v[1]+A[i][2]*v[2];
cout<<p[i]<<endl;
}
if (a<6)
{
cout << (p
int get_max(int *v, int n){
int max = v[0];
for (int i = 1; i < n; i++){
if (v[i] > max){
max = v[i];
}
}
return max;
}
int get_min(int *v, int n){
int min = v[0];
for (int i = 1; i < n; i++){
if (v[i] < min){
min = v[i];
}
}
return min;
}
#include <iostream>
#include <vector>
using namespace std;
int main(){
int array[10];
int min = 0;
int max = 0;
for(int i = 0; i < 10; i++){
cout << "Enter number " << i + 1 << ": ";
cin >> array[i];
if(i == 0){
min = array[0];
max = array[0];
}
if(min > array[i]){
min = array[i];
}
if(max < array[i]){
max = array[i];
}
}
cout << "Max value: " << max << endl;
cout << "Min value: " << min << endl;
return 0;
}
#include <iostream> //For cout
#include <vector> //For vectors
#include <algorithm> //For sort
//First define a function that multiplies a matrix by a vector
//This function is not the homework, it is just for convenience
std::vector<int> multiply(std::vector<std::vector<int>> matrix, std::vector<int> vector)
{
//Make an output vector of the correct size
std::vector<int> output(vector.size(), 0);
//Loop through the rows of the matrix
for(int i = 0; i < matrix.size(); i++)
{
//Loop through the columns of the matrix
for(int j = 0; j < matrix[0].size(); j++)
{
//Add the product to the output
output[i] += matrix[i][j] * vector[j];
}
}
//Return the result
return output;
}
int main()
{
//Define matrix A
std::
#include <iostream>
using namespace std;
int main(){
float A[3][3] = {{3,3,3},{4,9,8},{7,5,2}};
float v[3] = {8,1,4};
float result[3];
float minor = 0;
float major = 0;
for(int i = 0; i<3; i++){
result[i] = 0;
for(int j = 0; j<3; j++){
result[i] += A[i][j]*v[j];
}
}
for(int i = 0; i<3; i++){
cout << result[i] << endl;
}
for(int i = 0; i<3; i++){
if(result[i] > major)
major = result[i];
if(result[i] < minor)
minor = result[i
#include <iostream>
using namespace std;
int main()
{
float a,b,c,v1,v2,v3,v4,v5,v6,v7,v8,v9;
cout << "Ingresar a:";
cin >> a;
cout << "Ingresar b:";
cin >> b;
cout << "Ingresar c:";
cin >> c;
v1 = 3*a;
v2 = 3;
v3 = 3*c;
v4 = 4*b;
v5 = 9;
v6 = 8*a;
v7 = 7;
v8 = 5*c;
v9 = 2*c;
cout << "El producto de la matriz es:";
cout << v1 << " " << v2 << " " << v3 << endl;
cout << v4 << " " << v5 << " " << v6
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int a,b,c,v1,v2,v3,minimo,maximo;
cout<<"Ingrese el valor de a: ";
cin>>a;
cout<<"Ingrese el valor de b: ";
cin>>b;
cout<<"Ingrese el valor de c: ";
cin>>c;
v1=3*a+3*1+3*c;
v2=4*b+9*1+8*a;
v3=7*1+5*c+2*c;
cout<<"El vector resultante de la multiplicacion de la matriz A por el vector v es: ("<<v1<<","<<v2<<","<<v3<<")"<<endl;
if (a>=0 && a<=5){
minimo=v1;
if (v2<min
#include <iostream>
#include <string>
using namespace std;
void calcularPesos(int masas[], int pesos[], int aceleracion, int cantidad) {
for(int i=0; i<cantidad; i++){
pesos[i] = masas[i] * aceleracion;
}
}
int main() {
const int cantidad = 9;
int masas[cantidad] = {20,3,4,7,8,9,7,10,0};
int pesos[cantidad] = {0,0,0,0,0,0,0,0,0};
calcularPesos(masas, pesos, 9.81, cantidad);
for(int i=0; i<cantidad; i++){
cout << "Elemento " << i << ": " << pesos[i] << endl;
}
return 0;
}
void max_min(int *v, int n, int *max, int *min){
*max = *min = v[0];
for(int i = 0; i < n; i++){
if(v[i] > *max)
*max = v[i];
else if(v[i] < *min)
*min = v[i];
}
}
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int a, b, c;
char vector[3][3];
cout << "Ingrese valor de a:";
cin >> a;
cout << "Ingrese valor de b:";
cin >> b;
cout << "Ingrese valor de c:";
cin >> c;
vector[0][0] = 3 * a;
vector[0][1] = 3;
vector[0][2] = 3 * c;
vector[1][0] = 4 * b;
vector[1][1] = 9;
vector[1][2] = 8 * a;
vector[2][0] = 7;
vector[2][1] = 5 * c;
vector[2][2] = 2 * c;
cout << "La matriz es:" << endl;
for (int i = 0; i < 3; i
int max = array[0];
int min = array[0];
for (int i = 1; i < length; ++i) {
if (array[i] > max) {
max = array[i];
}
if (array[i] < min) {
min = array[i];
}
}
// function that: Escribir un programa que calcule el producto de la matriz A por el vector v. "a"=8 "b"=7 "c"=5
// Where the matrix A is:
// 3a 3 3c
// 4b 9 8a
// 7 5c 2c
// and the vector v is:
// 8c
// 1
// 4b
// Then write a function for:
// 1) If "a" takes values from 0 to 5, find the smallest element of the resulting vector
// 2) If "a" takes values from 6 to 9, find the largest element of the resulting vector. Show the result of the product and the smaller or larger value.
#include <iostream>
#include <conio.h>
using namespace std;
void my_function(int a, int b, int c) {
int A[3][3] = {{3 * a, 3, 3 * c},
{4 * b, 9, 8 * a},
{7, 5 * c
#include<iostream>
using namespace std;
int main()
{
int i,j;
int a,b,c;
int aux;
cout<<"Ingresa el valor de 'a': ";
cin>>a;
cout<<"Ingresa el valor de 'b': ";
cin>>b;
cout<<"Ingresa el valor de 'c': ";
cin>>c;
int A[3][3];
int V[3];
int sol[3];
A[0][0]=3*a;
A[0][1]=3;
A[0][2]=3*c;
A[1][0]=4*b;
A[1][1]=9;
A[1][2]=8*a;
A[2][0]=7;
A[2][1]=5*c;
A[2][2]=2*c;
cout<<"La matriz A es: "<<end
#include <iostream>
using namespace std;
//Defino la matriz
int A[3][3]={3,3,3,4,9,8,7,5,2};
//Defino el vector
int v[]={8,1,4};
//Defino el vector resultante
int resultado[3];
//Defino la función que realiza el producto
void producto(int matriz[3][3],int vector[3],int resultado[3]){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
resultado[i]+=matriz[i][j]*vector[j];
}
}
}
//Defino la función que busca el menor valor del vector resultante
int menor(int vector[3]){
int menor=vector[0];
for(int i=1;i<3;i++){
if(vector[i]<menor){
void vector(int v[]){
int maximo=v[0];
int minimo=v[0];
for(int i=0; i<=9; i++){
if(maximo<v[i]){
maximo=v[i];
}
if(minimo>v[i]){
minimo=v[i];
}
}
cout<<"El maximo elemento del vector es: "<<maximo<<endl;
cout<<"El minimo elemento del vector es: "<<minimo<<endl;
}
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int vector[3]={}; // declarar array
int matriz[3][3]={};
int a=0,b=0,c=0;
int v1=0,v2=0,v3=0,min=0,max=0;
cout<<"Ingrese valor de a: ";
cin>>a;
cout<<"Ingrese valor de b: ";
cin>>b;
cout<<"Ingrese valor de c: ";
cin>>c;
cout<<"\nLa matriz A es: ";
matriz[0][0]=3*a;
matriz[0][1]=3;
matriz[0][2]=3*c;
matriz[1][0]=4*b;
matriz[1][1]=9;
matriz[1][2]=8*a
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int a = 2;
int b = 3;
int c = 5;
vector<vector<int>> A = {
{3*a, 3, 3*c},
{4*b, 9, 8*a},
{7, 5*c, 2*c}};
vector<int> v = {8*c, 1, 4*b};
vector<int> result;
for (int f = 0; f < A.size(); f++)
{
int sum = 0;
for (int i = 0; i < A[f].size(); i++)
{
sum += A[f][i] * v[i];
}
result.push_back(sum);
}
for (int i = 0; i < result.size(); i++)
{
cout << result[i] << endl;
}
if (a
float Fuerza(float masa , float aceleracion){
float fuerza;
fuerza = masa * aceleracion;
return fuerza;
}
int main(){
float masa[9] = {20, 3, 4, 7, 8, 9, 7, 10};
float aceleracion = 9.81;
float pesos[9];
int i;
for (i=0; i<9; i++){
pesos[i] = Fuerza(masa[i], aceleracion);
}
for (i=0; i<9; i++){
printf("%f\n", pesos[i]);
}
return 0;
}
int max(int num_array[10]) {
int i;
int max = num_array[0];
int min = num_array[0];
for (i = 1; i < 10; i++) {
if (num_array[i] > max) {
max = num_array[i];
}
if (num_array[i] < min) {
min = num_array[i];
}
}
return max;
return min;
}
#include <iostream>
#include <vector>
using namespace std;
int main() {
int a, b, c;
int v1, v2, v3;
int ma, mb, mc;
vector<int> v(3);
cout << "Ingrese a" << endl;
cin >> a;
cout << "Ingrese b" << endl;
cin >> b;
cout << "Ingrese c" << endl;
cin >> c;
ma = 3 * a;
mb = 4 * b;
mc = 5 * c;
v[0] = ma * 3;
v[1] = mb * 9;
v[2] = mc * 2;
cout << "A = " << endl;
for (int i = 0; i < 3; i++) {
cout << v[i] << " ";
}
cout << endl;
v1 = 8 * c;
#include <iostream>
using namespace std;
int main()
{
int v[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int v_max, v_min;
v_max = v[0];
v_min = v[0];
for(int i = 1; i < 10; i++)
{
if(v[i] > v_max)
{
v_max = v[i];
}
if(v[i] < v_min)
{
v_min = v[i];
}
}
cout << "Max: " << v_max << endl;
cout << "Min: " << v_min << endl;
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
// Function to print elements of an array
void printArray(vector<int> arr, int n)
{
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
}
// Function to find the sum of an array
int sumArray(vector<int> arr, int n)
{
int sum = 0;
for (int i = 0; i < n; i++)
sum += arr[i];
return sum;
}
// Function to find the sum of an array
int maxArray(vector<int> arr, int n)
{
int max = arr[0];
for (int i = 0; i < n; i++)
if(arr[i]>max)
max = arr[i];
return max;
}
// Driver code
int main()
{
vector<int> arr = {1, 2, 3, 4
def producto_matriz_vector(a,b,c):
matriz = [[3*a,3,3*c],[4*b,9,8*a],[7,5*c,2*c]]
vector = [8*c,1,4*b]
producto = []
for i in range(3):
suma = 0
for j in range(3):
suma += matriz[i][j] * vector[j]
producto.append(suma)
return producto
def funcion(a):
producto = producto_matriz_vector(a,7,5)
if a in range(0,6):
print("El menor elemento del vector resultante es",min(producto))
elif a in range(6,10):
print("El mayor elemento del vector resultante es",max(producto))
funcion(8)
int* minMax(int array[]){
int* result = new int[2];
result[0] = array[0];
result[1] = array[0];
for ( int i = 1; i < 10; i++ ){
if ( array[i] < result[0] ) result[0] = array[i];
if ( array[i] > result[1] ) result[1] = array[i];
}
return result;
}
#include <iostream>
int main() {
int A[2][3] = {{24, 3, 15},
{28, 9, 64}};
int v[3] = {40, 1, 28};
int result [2] = {0, 0};
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
result[i] += A[i][j] * v[j];
}
}
for (auto i : result) {
std::cout << i << '\n';
}
return 0;
}
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int i, j, a, b, c, v1, v2, v3;
cout << "Ingrese el valor de a: " << endl;
cin >> a;
cout << "Ingrese el valor de b: " << endl;
cin >> b;
cout << "Ingrese el valor de c: " << endl;
cin >> c;
int A[3][3] = {
{3*a, 3, 3*c},
{4*b, 9, 8*a},
{7, 5*c, 2*c}
};
int v[3] = {8*c, 1, 4*b};
cout << "El vector v es: \n";
for (i = 0; i < 3; i++) {
cout << v[i] << endl;
void multiplicar(int a, int b, int c){
int A[3][3] = {3*a,3,3*c,4*b,9,8*a,7,5*c,2*c};
int v[3] = {8*c,1,4*b};
int resultado[3];
int menor[5];
int mayor[4];
for (int i = 0; i < 3; i++){
int suma = 0;
for (int j = 0; j < 3; j++){
suma += A[i][j]*v[j];
}
resultado[i] = suma;
}
cout << "Resultado: " << endl;
for (int i = 0; i < 3; i++){
cout << resultado[i] << " ";
}
cout << endl;
if(a >= 0 && a <= 5){
int men = resultado[0];
#include<iostream>
using namespace std;
int main(){
int a = 8, b = 7, c = 5;
int v[3]={8*c, 1, 4*b};
int A[3][3]={3*a, 3, 3*c, 4*b, 9, 8*a, 7, 5*c, 2*c};
int producto[3];
for(int i=0; i<3; i++){
producto[i]=0;
for(int j=0; j<3; j++){
producto[i]+=A[i][j]*v[j];
}
}
if(a<6){
int menor=producto[0];
for(int i=0; i<3; i++){
if(menor>producto[i]){
menor=producto[i];
}
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cout << "Enter a: ";
cin >> a;
cout << "Enter b: ";
cin >> b;
cout << "Enter c: ";
cin >> c;
int A[3][3] = {
{3*a, 3, 3*c},
{4*b, 9, 8*a},
{7, 5*c, 2*c}
};
int v[3] = {8*c, 1, 4*b};
int product[3] = {0, 0, 0};
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
product[i] += A[i][j] * v[j];
}
}
cout << "The product is: ";
for (int i = 0; i < 3; i++) {
#include <iostream>
#include <cmath>
using namespace std;
void producto(int a, int b, int c);
int main(int argc, char const *argv[])
{
int a, b, c;
cin>>a>>b>>c;
producto(a,b,c);
return 0;
}
void producto(int a, int b, int c){
if(a>5){
int max;
int vector[3];
vector[0] = 3*a + 3 + 3*c;
vector[1] = 4*b + 9 + 8*a;
vector[2] = 7 + 5*c + 2*c;
max = vector[0];
for (int i = 1; i < 3; i++)
{
if(vector[i]>max) max = vector[i];
}
cout<<"El valor maximo es: "<<max<<endl;
}else{
//pseudo code
#include <iostream>
#include <vector>
using namespace std;
vector<int> vectorFuncion(vector<int> v){
int max = 0;
int min = 0;
for (std::vector<int>::iterator i = v.begin(); i != v.end(); ++i){
if(*i > max){
max = *i;
}
else if (*i < min){
min = *i;
}
}
vector<int> aux;
aux.push_back(max);
aux.push_back(min);
return aux;
}
int main(int argc, char const *argv[]) {
vector<int> v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
v.push_back(4);
v.push_back(5);
v.push_back(6);
v.push_
#include <iostream>
using namespace std;
int main() {
int a, b, c, mult;
cin >> a >> b >> c;
mult = a * b * c;
cout << mult;
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int multiplicarVector(int v[4], int A[3][3], int resultado[3]);
int mayor (int resultado[3], int a);
int menor (int resultado[3], int a);
int main()
{
int A[3][3]={{3*a,3,3*c},{4*b,9,8*a},{7,5*c,2*c}};
int v[4]={8*c,1,4*b,0};
int resultado[3];
int a,b,c;
printf ("Ingrese valores de a, b, c: ");
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
multiplicarVector(v,A,resultado);
if (a>=6 && a<=9){
mayor(resultado,a);
}
void calcular(int v[], int &min, int &max){
min = max = v[0];
for(int i = 1; i < 10; ++i){
if(v[i] < min)
min = v[i];
if(v[i] > max)
max = v[i];
}
}
#include <iostream>
using namespace std;
// matriz A
const int m = 3; // filas
const int n = 3; // columnas
int A[m][n]; // matriz
// vector v
const int p = 3; // tamaño del vector
int v[p]; // vector
// vector resultante
int w[m]; // vector resultante
// función para inicializar la matriz
void initialise_matrix(int A[m][n])
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
A[i][j] = (i + 1) * (j + 1);
}
}
}
// función para imprimir la matriz
void print_matrix(int A[m][n])
{
cout << "Matriz A:" << endl;
for (int i = 0; i < m; i++)
{
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
double a, b, c;
double v1, v2, v3;
double resultado[3];
cout<<"Valor de a: ";
cin>>a;
cout<<"Valor de b: ";
cin>>b;
cout<<"Valor de c: ";
cin>>c;
v1=3*a+3+3*c;
v2=4*b+9+8*a;
v3=7+5*c+2*c;
resultado[0]=v1;
resultado[1]=v2;
resultado[2]=v3;
cout<<"\nResultado del Producto: "<<endl;
cout<<"v1: "<<v1<<endl;
cout<<"v2: "<<v2<<endl;
cout<<"v3: "<<v3
int v[10];
v[10]={1,2,3,4,5,6,7,8,9,10};
int max, min, i;
max=min=v[0];
for ( i=1; i<10; i++){
if (v[i]>max){max=v[i];}
if (v[i]<min){min=v[i];}
}
cout<<"max="<<max<<"\n";
cout<<"min="<<min<<"\n";
#include <iostream>
using namespace std;
int main()
{
//variables
int a, b, c, x1, x2, x3;
//input
cout<<"Ingrese el valor de a: "; cin>>a;
cout<<"Ingrese el valor de b: "; cin>>b;
cout<<"Ingrese el valor de c: "; cin>>c;
if (a>=6)
{
x1=3*a + 3 + 3*c;
x2=4*b + 9 + 8*a;
x3=7 + 5*c + 2*c;
cout<<"El menor elemento es: "<<min(x1,min(x2,x3))<<endl;
}
else
{
x1=3*a + 3 + 3*c;
x2=4*b + 9 + 8*a;
x3=7 + 5*c + 2
#include <iostream>
using namespace std;
//Variables globales
int a, b, c, vector[3], matriz[3][3];
//Declaracion de funciones
void lectura();
void producto(int vector[], int matriz[][3], int a, int b, int c);
int main(){
lectura();
producto(vector, matriz, a, b, c);
getchar();
return 0;
}
void lectura(){
cout << "Ingrese el valor de a: ";
cin >> a;
cout << "Ingrese el valor de b: ";
cin >> b;
cout << "Ingrese el valor de c: ";
cin >> c;
cout << "Ingrese los elementos del vector (tres valores): ";
for(int i=0; i<3; i++){
cin >> vector[i];
}
cout
void minMax(int *v){
int min = v[0];
int max = v[0];
for(int i = 1; i < 10; i++){
if(v[i] < min){
min = v[i];
}else if(v[i] > max){
max = v[i];
}
}
cout << "min : " << min << " max : " << max << endl;
}
#include <iostream>
using namespace std;
int main()
{
int matriz[3][3];
matriz[0][0]=24;
matriz[0][1]=3;
matriz[0][2]=15;
matriz[1][0]=28;
matriz[1][1]=9;
matriz[1][2]=64;
matriz[2][0]=7;
matriz[2][1]=25;
matriz[2][2]=10;
int vector[3];
vector[0]=40;
vector[1]=1;
vector[2]=28;
int resultado[3];
for(int i=0;i<3;i++){
int suma = 0;
for(int j=0;j<3;j++){
suma += matriz[i][j]*vector[j];
}
resultado[i]=suma;
}
int mayor = resultado
#include<stdio.h>
void main()
{
int a, b, c, matriz[2][3], vector[3], r[2];
printf("Introduzca el primer valor de la matriz: ");
scanf("%d", &a);
printf("Introduzca el segundo valor de la matriz: ");
scanf("%d", &b);
printf("Introduzca el tercer valor de la matriz: ");
scanf("%d", &c);
printf("Introduzca los valores del vector: ");
for(int i=0; i<3; i++)
{
scanf("%d", &vector[i]);
}
matriz[0][0]=3*a;
matriz[0][1]=3;
matriz[0][2]=3*c;
matriz[1][0]=4*b;
matriz[1][1]=9;
matriz[1][2]=
#include <iostream>
using namespace std;
void producto(int a, int b, int c, int v[3]){
int A[3][3];
int sol[3];
A[0][0]=3*a; A[0][1]=3; A[0][2]=3*c;
A[1][0]=4*b; A[1][1]=9; A[1][2]=8*a;
A[2][0]=7; A[2][1]=5*c; A[2][2]=2*c;
for(int i=0;i<3;i++){
sol[i]=0;
for(int j=0;j<3;j++)
sol[i]+=A[i][j]*v[j];}
cout<<"El producto es: "<<endl;
for(int i=0;i<3;i++){
cout<<sol[i
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//funcion de multiplicacion
int multiplicar(int A[],int v[])
{
int i,j,producto;
for(i=0;i<3;i++)
for(j=0;j<3;j++)
producto+=A[i]*v[j];
return producto;
}
//funcion para mostrar el valor del vector
int mostrar(int A[])
{
int i;
for(i=0;i<3;i++)
printf("%d\n",A[i]);
}
//funcion para saber el mayor
int mayor(int A[])
{
int i,may;
may=A[0];
for(i=1;i<3;i++)
if(A[i]>may)
may=A[i];
return may;
}
int main()
{
#include <iostream>
using namespace std;
int main(){
int a,b,c,i,j,k,vector[3],matriz[3][3];
cout<<"Ingrese el valor de a:"<<endl;
cin>>a;
cout<<"Ingrese el valor de b:"<<endl;
cin>>b;
cout<<"Ingrese el valor de c:"<<endl;
cin>>c;
matriz[0][0]=3*a;
matriz[0][1]=3;
matriz[0][2]=3*c;
matriz[1][0]=4*b;
matriz[1][1]=9;
matriz[1][2]=8*a;
matriz[2][0]=7;
matriz[2][1]=5*c;
matriz[2][2]=2*c
int minmax(int *v){
int min = v[0];
int max = v[0];
for(int i = 0; i < 10; i++){
if(v[i] < min)
min = v[i];
if(v[i] > max)
max = v[i];
}
return min, max;
}
#include <iostream>
#include <vector>
using namespace std;
void minMaxVector(vector<int> vec);
int main() {
vector<int> vec = {2, 1, 7, 3, 9, 15, 5};
minMaxVector(vec);
}
void minMaxVector(vector<int> vec) {
int min = 0, max = 0;
for(int i = 0; i < vec.size(); i++) {
if(vec[i] < min)
min = vec[i];
if(vec[i] > max)
max = vec[i];
}
cout << "El numero minimo es: " << min << endl;
cout << "El numero maximo es: " << max << endl;
}
#include <iostream> //Include all the libraries
#include <cmath>
using namespace std;
int main() {
//Declaracion de variables
float a;
float b;
float c;
float num1;
float num2;
float num3;
float num4;
float num5;
float num6;
float num7;
float num8;
float num9;
float num10;
float num11;
int num12;
float num13;
float num14;
float num15;
float num16;
float num17;
float num18;
float num19;
float num20;
float num21;
float num22;
float num23;
float num24;
float num25;
float num26;
float num27;
float num28;
float num29;
float num30;
float num31;
float num32;