Hertz Posted December 3, 2009 Report Posted December 3, 2009 Se da urmatoarea secventa de numere :10000? (3n+2) / (2n+3)n = 1Care este suma totala a celei de-a 3-a zecimala din fiecare numar.Daca e numar intreg,adauga 0,deoarece nu va afecta rezultatul.Exemplu :1.4378125 2.49321757 + 3 = 10 Quote
begood Posted December 3, 2009 Report Posted December 3, 2009 87112 #include<iostream.h>#include<math.h>void main() { unsigned long s=0; double x; for(long i=1;i<=10000;i++) { x=double(i); s+=long(double((3*x+2)/(2*x+3))*1000)%10; } cout<<s; }//editeaza titlul.poate e cu o microsecunda mai rapid (n-1)/(2x+3) Quote