fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. cout << "OVERDAMPED" << endl << endl;
  7.  
  8. for (double b = 0; b <= 19; b++)
  9. {
  10. for (double c = -19; c < 0; c++)
  11. {
  12. if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
  13. {
  14. if (b == 0)
  15. {
  16. cout << "y'' + " << b << "y' - " << -c << "y = f(x)" << endl;
  17. }
  18. else
  19. {
  20. cout << "y'' +/- " << b << "y' - " << -c << "y = f(x)" << endl;
  21. }
  22. }
  23. }
  24.  
  25. for (double c = 0; c <= 19; c++)
  26. {
  27. if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
  28. {
  29. if (b == 0)
  30. {
  31. cout << "y'' + " << b << "y' + " << c << "y = f(x)" << endl;
  32. }
  33. else
  34. {
  35. cout << "y'' +/- " << b << "y' + " << c << "y = f(x)" << endl;
  36. }
  37. }
  38. }
  39. }
  40.  
  41. cout << endl << "CRITICALLY DAMPED" << endl << endl;
  42.  
  43. for (double b = 0; b <= 19; b++)
  44. {
  45. for (double c = -19; c < 0; c++)
  46. {
  47. if ((b * b) - (4 * c) == 0)
  48. {
  49. if (b == 0)
  50. {
  51. cout << "y'' + " << b << "y' - " << -c << "y = f(x)" << endl;
  52. }
  53. else
  54. {
  55. cout << "y'' +/- " << b << "y' - " << -c << "y = f(x)" << endl;
  56. }
  57. }
  58. }
  59.  
  60. for (double c = 0; c <= 19; c++)
  61. {
  62. if ((b * b) - (4 * c) == 0)
  63. {
  64. if (b == 0)
  65. {
  66. cout << "y'' + " << b << "y' + " << c << "y = f(x)" << endl;
  67. }
  68. else
  69. {
  70. cout << "y'' +/- " << b << "y' + " << c << "y = f(x)" << endl;
  71. }
  72. }
  73. }
  74. }
  75.  
  76. cout << endl << "UNDERDAMPED" << endl << endl;
  77.  
  78. for (double b = 0; b <= 19; b++)
  79. {
  80. for (double c = -19; c < 0; c++)
  81. {
  82. if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
  83. {
  84. if (b == 0)
  85. {
  86. cout << "y'' + " << b << "y' - " << -c << "y = f(x)" << endl;
  87. }
  88. else
  89. {
  90. cout << "y'' +/- " << b << "y' - " << -c << "y = f(x)" << endl;
  91. }
  92. }
  93. }
  94.  
  95. for (double c = 0; c <= 19; c++)
  96. {
  97. if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
  98. {
  99. if (b == 0)
  100. {
  101. cout << "y'' + " << b << "y' + " << c << "y = f(x)" << endl;
  102. }
  103. else
  104. {
  105. cout << "y'' +/- " << b << "y' + " << c << "y = f(x)" << endl;
  106. }
  107. }
  108. }
  109. }
  110.  
  111. cout << endl << endl;
  112. return 0;
  113. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:8: error: ‘sqrt’ was not declared in this scope
    if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
        ^~~~
prog.cpp:12:8: note: suggested alternative: ‘qsort’
    if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
        ^~~~
        qsort
prog.cpp:12:35: error: ‘floor’ was not declared in this scope
    if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
                                   ^~~~~
prog.cpp:12:35: note: suggested alternative: ‘float’
    if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
                                   ^~~~~
                                   float
prog.cpp:27:8: error: ‘sqrt’ was not declared in this scope
    if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
        ^~~~
prog.cpp:27:8: note: suggested alternative: ‘qsort’
    if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
        ^~~~
        qsort
prog.cpp:27:35: error: ‘floor’ was not declared in this scope
    if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
                                   ^~~~~
prog.cpp:27:35: note: suggested alternative: ‘float’
    if (sqrt((b * b) - (4 * c)) == floor(sqrt((b * b) - (4 * c))) && (b * b) - (4 * c) != 0)
                                   ^~~~~
                                   float
prog.cpp:82:8: error: ‘sqrt’ was not declared in this scope
    if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
        ^~~~
prog.cpp:82:8: note: suggested alternative: ‘qsort’
    if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
        ^~~~
        qsort
prog.cpp:82:35: error: ‘floor’ was not declared in this scope
    if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
                                   ^~~~~
prog.cpp:82:35: note: suggested alternative: ‘float’
    if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
                                   ^~~~~
                                   float
prog.cpp:97:8: error: ‘sqrt’ was not declared in this scope
    if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
        ^~~~
prog.cpp:97:8: note: suggested alternative: ‘qsort’
    if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
        ^~~~
        qsort
prog.cpp:97:35: error: ‘floor’ was not declared in this scope
    if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
                                   ^~~~~
prog.cpp:97:35: note: suggested alternative: ‘float’
    if (sqrt((4 * c) - (b * b)) == floor(sqrt((4 * c) - (b * b))) && (b * b) - (4 * c) != 0)
                                   ^~~~~
                                   float
stdout
Standard output is empty