Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- //2^3+4^3+6^3.....
- long long sum1 = 0;
- for(long long st = 2;st<=100;st+=2){
- sum1 += pow(st,3);
- }
- //1+3+5+7.....
- long long sum2 = 0;
- for(long long st = 1;st<=99;st+=2){
- sum2 += st;
- }
- cout << sum1 << " , " << sum2 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment