6 Şubat 2013 Çarşamba

Nineth solution of Project Euler






#include "stdafx.h"
#include <iostream>
using namespace std;
void findout() {    
     int a,b,c;
for(a=5;a<1000;a++) {
for(b=4;b<a;b++) {
for(c=3;c<b;c++) {
if((a+b+c) == 1000 && ((c*c) + (b*b)) == (a*a)) {
cout << "Sonuc :" << a * b * c << endl << "Sayilar : " << a << "," << b << "," << c << endl;
cout << "efekanpulatli.blogspot.com" << endl;
}

}
}
}

 }

int main()
{
 findout();
system("pause");
return 0;
}

Seventh solution of Project Euler







#include "stdafx.h"
#include <iostream>
using namespace std;
void findout() {       // let's begin find out 10001 prime number
   int a,c=0,dizi[10002],d=0;
           for(a=1;d<10002;a++){
c=0;
for(int i=2;i<a;i++) {
if(a%i==0) {
c++;
}
}
if(c==0) {
dizi[d] = a;
d++;
}
}
cout << "10001.Prime Number : " << dizi[10001] << " efekanpulatli.blogspot.com" << endl;
}

int main()
{
 findout();
system("pause");
return 0;
}

Sixth solution of Project Euler


   


#include "stdafx.h"
#include <iostream>
using namespace std;  
void findout() {  
      int a,b=0,c=0;

for(a=1;a<101;a++) {
b+=a;
c+=(a*a);
}
       b*=b;
  cout << "Result :" << b-c << " efekanpulatli.blogspot.com" << endl;
}

int main()
{
 findout();
system("pause");
return 0;
}

Fifth solution of Project Euler








#include "stdafx.h"
#include <iostream>
using namespace std;  
void findout() {  
int c=0,i=10000;
for(;;i++) {
c=0;
for(int a=1;a<21;a++) {

if(i%a!=0) {
c++;
};
}
if(c==0) {
break;
}
}
cout << "Sonuc :" << i  << " efekanpulatli.blogspot.com" << endl;
}

int main()
{
 findout();
system("pause");
return 0;
}

5 Şubat 2013 Salı

Fourth solution of Project Euler







#include "stdafx.h"
#include <iostream>
using namespace std;                  

void findout() {
int a,b,x,c=1,y,z;
for(a=999;a>=100;a--) {
for(b=999;b>=100;b--) {
x = a*b;
if((x/100000) == (x % 10) && ((x/10000) % 10) == ((x%100) / 10) && ((x/1000) %10) == ((x%1000) / 100) && x>c) {
c=x;
y=a;
z=b;
}
}
if((x/100000) == (x % 10) && ((x/10000) % 10) == ((x%100) / 10) && ((x/1000) %10) == ((x%1000) / 100) && x>c) {
c=x;
y=a;
z=b;
}

}
cout << "Cevap :" << c << "  sayilar :" << y << " ve " << z <<  "   efekanpulatli.blogspot.com" <<   endl;
}

int main()
{
findout();
system("pause");
return 0;
}

Second solution of Project Euler






#include "stdafx.h"
#include <iostream>
using namespace std;          

void findout() {                  //efekanpulatli.blogspot.com        second problem's solution
 int tot=2,dizi[10000];
 dizi[0] = 1;
 dizi[1] = 2;
 for(int i=2;dizi[i-1]<4000000;i++) {

  dizi[i] = dizi[i-1] +  dizi[i-2];
  if(dizi[i] % 2 == 0) {
  tot+=dizi[i];
  cout << "fibonacci row :" << dizi[i] << "----------" << "tot after plus :" << tot << "----------" << endl;
  }

 }

 cout << "Result :" <<  tot << " efekanpulatli.blogspot.com"<< endl;
}
int main()
{
 findout();
system("pause");
return 0;
}

First solution of Project Euler













#include "stdafx.h"
#include <iostream>
using namespace std;              //http://projecteuler.net/problem=1

void findout() {                  //efekanpulatli.blogspot.com        first problem's solution
int tot=0;
for(int i=1;i<1000;i++) {
if(i % 3 == 0 || i%5 == 0) {
tot+=i;
}
}
cout << tot << " efekanpulatli.blogspot.com"<< endl;
}
int main()
{
findout();
system("pause");
return 0;
}