8 Şubat 2013 Cuma

Twelfth solution of Project Euler






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

void findout () {
int a,b,c,dizi[20000],d;
for(a=1;a<20000;a++) {                //sayilari diziye atıyoruz
dizi[a] = (a * (a+1)) / 2;
}
           for(b=9999;b<15000;b++) {
  d=0;
  for(c=1;c<=dizi[b];c++) {
  if(dizi[b] %c == 0) {
  d++;
  }
 
  }
   
  if(d>500) {
  cout << dizi[b] <<  " efekanpulatli.blogspot.com" << endl;
  break;
  }

  }
}


int main() {

findout();
system("pause");
return 0;
}

Hiç yorum yok:

Yorum Gönder