Advertisement
Josif_tepe

Untitled

Mar 29th, 2024
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9.  
  10.  
  11.  
  12. int n,k;
  13. cin>>n>>k;
  14. int najmal=1,najgolem=n;
  15.  
  16.  
  17. for(int i=k;i>=1;i--){
  18.     najmal*=2;
  19.  
  20.  
  21. }
  22.  
  23.  
  24. najmal+=n-1;
  25.  
  26.  
  27. for(int  i=k;i>=1;i--){
  28.  
  29.  
  30.    najgolem*=2;
  31.  
  32.  
  33. }
  34.  
  35.  
  36. cout<<najmal<<endl;
  37. cout<<najgolem<<endl;
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement