Xem bài viết đơn
Old 15-01-2013, 07:59 AM   #36
chemthan
Administrator

 
chemthan's Avatar
 
Tham gia ngày: Mar 2009
Bài gởi: 349
Thanks: 0
Thanked 308 Times in 161 Posts
Code C++ nè.
PHP Code:
#include <iostream>

void Count(intoutputint aint bint step)
{
    if (
== 2013)
        
output++;
    else if (
step 2013 && 2013)
    {
        
Count(outputabstep 1);
        
Count(outputbbstep 1);
    }
}

void main()
{
    
int output 0;
    for (
int i 11000i++)
        
Count(outputi10);
    
std::cout<<output<<"\n";
    
system("pause");


[RIGHT][I][B]Nguồn: MathScope.ORG[/B][/I][/RIGHT]
 

thay đổi nội dung bởi: chemthan, 15-01-2013 lúc 08:17 AM
chemthan is offline   Trả Lời Với Trích Dẫn
The Following 2 Users Say Thank You to chemthan For This Useful Post:
huynhcongbang (15-01-2013), Raul Chavez (24-06-2013)
 
[page compression: 13.14 k/14.31 k (8.22%)]