fork download
  1.  
  2. //Multiplicative sequence
  3. #include<bits/stdc++.h>
  4. #define pi 3.141592653589793
  5. #define ll long long int
  6. #define Allv v.begin(),v.end()
  7. #define fast ios_base::sync_with_stdio(0); cin.tie(0);
  8. #define yes cout<<"YES"<<endl
  9. #define no cout<<"NO"<<endl
  10. using namespace std;
  11. void solve()
  12. {
  13. double x,r;
  14. int n,i;
  15. cin>>x>>r>>n;
  16. printf("%.2lf ",x);
  17. for(i=2;i<=n;i++)
  18. {
  19. x*=r;
  20. printf("%.2lf ",x);
  21. }
  22. printf("\n");
  23. }
  24. int main()
  25. {
  26.  
  27.  
  28. solve();
  29. return 0;
  30.  
  31. }
  32.  
  33.  
Success #stdin #stdout 0s 5420KB
stdin
128.00 0.5 7
stdout
128.00 64.00 32.00 16.00 8.00 4.00 2.00