Código (bash) [Seleccionar]
#!/usr/bin/bash
read -p "Nombre : " name
echo -e "Tu nombre es : ${name}";
Las dudas sobre shell script/Bash van en Scripting.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú#!/usr/bin/bash
read -p "Nombre : " name
echo -e "Tu nombre es : ${name}";
Return Value
On success, the function returns the number of items succesfully read. This count can match the expected number of readings or fewer, even zero, if a matching failure happens.
In the case of an input failure before any data could be successfully read, EOF is returned.
void encontrar(const int **m, const int& f, const int &c, const int &valor)
{
int posF = -1, posC = -1;
for(unsigned int i = 0; i < f; i++)
for(unsigned int j = 0; j < c; j++)
if(m[i][j] == valor)
{
posF = i;
posC = j;
break;
}
if(posF != -1)
cout << "El dato " << valor << " se encuentra en la fila " << posF << " columna " << posC << endl;
else
cout << "Valor no encontrado" << endl;
}
Cita de: BlacKGilgamesH en 8 Septiembre 2010, 02:07 AM
Me podrias especificar bien eso porfavor?
Saludos
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main(void)
{
unsigned int filas, columnas;
cout << "Filas : ";
cin >> filas;
cout << "Columnas : ";
cin >> columnas;
signed int **matriz = new int*[filas];
for(unsigned int i = 0; i < filas; i++)
matriz[i] = new int[columnas];
// Algoritmo para lo demás
for(unsigned int i = 0; i < filas; i++)
delete[] matriz[i];
delete[] matriz;
return 0;
}