Project Euler #1: Multiples of 3 and 5

  • + 0 comments

    int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int sum =0; int n; cin >> n; for(int i = 3; i < n; i++){ if(i%3==0 || i%5==0){ sum+=i; } }

        cout<<sum<<endl;
    }
    
        time limit problem in this program ,help to solve the problem
    
    
    
    
    
    hgdshfhs