Skip to content

Instantly share code, notes, and snippets.

View bananas.cpp
#include <iostream>
#include <fstream>
using namespace std;
int LineasBananas(string lineas){
int x=0, bananas=0;
for(int i=0; i<lineas.length(); i++){
lineas[i] = tolower(lineas[i]);
@Adals20
Adals20 / Botones.ino
Created Apr 27, 2017
Programa de muestra que utiliza 2 botones para configurar las posiciones posibles del cuadrupedo
View Botones.ino
//Codigo chido Adal
#include <Servo.h>
Servo servo1; // Se crea un objetos de tipo servo para poder controlarlos
Servo servo2;
Servo servo3;
Servo servo4;
Servo servo5;
Servo servo6;
Servo servo7;
View yosoy196.cpp
// Solving Problems with Programming
// Professor Ken Bauer
//
// Your name here
// Your student# here
// If you worked with somebody else, you need to put their names here
#include <iostream>
#include <string>
using namespace std;
View e.cpp
#include <iostream>
#include <cmath>
using namespace std;
double factorial(double x);
double eee(double presicion){
double x = 1, i = 0, y = 1, y1=0;
do{
y1 = y;
View baby.cpp
#include <iostream>
#include <cmath>
using namespace std;
float Baby(double x){
double error = 0.0001, y;
y = x;
while((y-x/y)>error){
y = (y+x/y)/2;
}
View nT.cpp
#include <iostream>
using namespace std;
void linea(int n){
int i = 0, f =0;
if (i<=n){
for (i =0; i<= n; i++)
cout << "T";
}
cout <<"\n";
View puntom.cpp
#include <iostream>
#include <cmath>
using namespace std;
float distance(float x1,float y1,float x2,float y2){
float d = sqrt(pow((x2-x1),2)+pow((y2-y1),2));
return d;
}
main(){
View contapal.cpp
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main (){
int palabras=0, lineas=0;
const string nfichero = "texto.txt";
string cadena;
ifstream fichero;
View loop.cpp
#include <iostream>
using namespace std;
int fibonacci (int n){
int i, primero = 0, segundo =1, resul =0;
for (i=1; i<n; i++){
resul = primero + segundo;
primero = segundo;
segundo = resul;
}
View recursion.cpp
#include <iostream>
using namespace std;
int fibonacci (int n){
if (n==0)
return 0;
else if (n==1 || n== 2)
return 1;
else{
return fibonacci (n-1) + fibonacci (n-2);