Skip to content

Instantly share code, notes, and snippets.

@Crepu
Created May 25, 2017 03:32
Show Gist options
  • Select an option

  • Save Crepu/0ac990ebce2403b8d3439b26c7d42b11 to your computer and use it in GitHub Desktop.

Select an option

Save Crepu/0ac990ebce2403b8d3439b26c7d42b11 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
float f(float x){
return x*x;
}
float g(float c, float v, float b ){
return (c+b+v)/3;
}
int main(int argc, char const *argv[])
{
int caca[3];
int fecha = 200410;
int dia, mes, anio;
for(int i=0; i<3;++i){
caca[i] = fecha%100;
fecha = fecha/100;
}
for (int i = 0; i < 3; ++i)
{
cout<<f(caca[i])<<endl;
}
cout<< g(caca[0],caca[1],caca[2])<< endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment