Project Euler #1: Multiples of 3 and 5

  • + 3 comments
    time limit problem in this program ,help to solve the problem
    

    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;
    }