Tarango

Untitled

Oct 30th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     //2^3+4^3+6^3.....
  6.     long long sum1 = 0;
  7.     for(long long st = 2;st<=100;st+=2){
  8.         sum1 += pow(st,3);
  9.     }
  10.     //1+3+5+7.....
  11.     long long sum2 = 0;
  12.     for(long long st = 1;st<=99;st+=2){
  13.         sum2 += st;
  14.     }
  15.     cout << sum1 << " , " << sum2 << endl;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment