fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main()
  5. {
  6. float PI=3.1416;
  7. for(int i=0;i<8;i++)
  8. {
  9. float tmp=sin(2*PI*1000*i*(1/8000))+0.5*sin(2*PI*2000*i*(1/8000)+(3*PI/4));
  10. cout << "x(" << i << ") = " << tmp << "\n";
  11. }
  12. cout << "\n";
  13. return 0;
  14. }
Success #stdin #stdout 0.02s 2680KB
stdin
Standard input is empty
stdout
x(0) = 0.353551
x(1) = 0.353551
x(2) = 0.353551
x(3) = 0.353551
x(4) = 0.353551
x(5) = 0.353551
x(6) = 0.353551
x(7) = 0.353551