#include <iostream> #include <cmath> using namespace std; int main() { int n; //вводимое число int m; //степень двойки int k; // число в степени cin>>n; while(k<n ) { m=1; k=pow(2,m); m++; cout<<k<<" "; } return 0; }
Standard input is empty
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!