Advertisement
DarthLucius

Print Squares and Cubes-8532 (1)

Mar 5th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main () {
  5.     int a,b;
  6.     long long s,c;
  7.     cin>>a>>b;
  8.     if(0<=a&&a<=b&&b<=10000){
  9.     for(int i=a;i<=b;i++){
  10.         s=pow(i,2);
  11.         cout<<s<<" ";
  12.     }
  13.     cout<<endl;
  14.     for (int j=b;j>=a;j--){
  15.         c=pow(j,3);
  16.         cout<<c<<" ";
  17.     }
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement