Skip to content

Instantly share code, notes, and snippets.

View batmantec's full-sized avatar

ChristianMoreno batmantec

View GitHub Profile
#include <iostream>
#include <string>
using namespace std;
void triangle(int t){
int i, x;
for (i = 0; i <= t; i++){
cout << endl;
for (x = 0; x < i; x++){
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
// Functions from other programs
int sum(int a, int b){
#include <iostream>
#include <cmath>
using std::endl;
using std::cout;
using std::cin;
float getTotal (float nums[], int allNums){
float answer=0.0;
for (int i = 0; i < allNums; i++) {
answer=answer+nums[i];
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int CheckFile(string fileName){
ifstream InList;
InList.open(fileName.c_str());
if (InList.is_open()) {
cout << "File Open" << endl;
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int dotProduct(int num1, int num2){
int ans;
ans = num1*num2;
return ans;
}
#include <Servo.h>
Servo myservo;
int pos = 0;
void setup() {
myservo.attach(9); //pin9
}
void loop() {
for (pos = 0; pos <= 360; pos += 1) {
myservo.write(pos);
delay(15);
#include <iostream>
#include <cmath>
#include <iomanip>
using std::cout;
using std::cin;
using std::endl;
using std::setprecision;
int numPre(long double x){
int num = 0;
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
void checkPal(string word){
int i;
for(i=0; i<(word.size()/2); i++){
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int checkMod3(int checkNum){
int work, ans;
work = checkNum%3;
if (work == 0){
ans = checkNum;
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include "BigIntegerLibrary.hh"
BigInteger checkReverse(BigInteger num) { /*Codigo sacado de internet*/
BigInteger reverse = 0;
while(num != 0) {