This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using std::cin; | |
using std::cout; | |
using std::endl; | |
int main(){ | |
char phrase[100]; | |
int vocala=0; | |
cout<< "Write a phrase" << endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
double sqrt(double); | |
int main() | |
{ | |
int x; | |
cout<< "Give a number"<< endl; | |
cin>> x; | |
double result = sqrt(x); | |
cout<< "Final result is "<< result<< endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <string> | |
using namespace std; | |
struct datos | |
{ | |
int l,c; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
using std::cout; | |
using std::cin; | |
using std::endl; | |
float total(float array[],int size){ | |
float sum = 0.0; | |
for (int i=0;i<size;i++){ | |
sum=sum+array[i]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
using std::cin; | |
using std::endl; | |
// returns the minimum value (smallest) of a b c d | |
float minimum_of_4(float a, float b, float c, float d){ | |
if(a<b && a<c && a<d) {return a;} | |
if(b<a && b<c && b<d) {return b;} | |
if(c<b && c<a && c<d) {return c;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
using std::cout; | |
using std::cin; | |
using std::endl; | |
float total(float array[],int size){ | |
float sum = 0.0; | |
for (int i=0;i<size;i++){ | |
sum=sum+array[i]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
using std::cin; | |
using std::endl; | |
// input is a non-negative value | |
// output is the factorial of n. | |
// remember that 0! is 1 | |
// fix the wrong answer of always 42 | |
unsigned long long factorial(unsigned long long n){ | |
if (n==0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <algorithm> | |
using namespace std; | |
int main () | |
{ | |
int X, Y; | |
double long A; | |
string another; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
int sum (int x,int y) | |
{ | |
int sum; | |
sum=x+y; | |
return sum; | |
} |