• помогите пожалуйста. буду очень благодарен. спасибо. с++​

    question img

Ответы 1

  • №1.1

    #include <iostream>

    using namespace std;

    int main(){

    for(int i=1; i<=5; ++i){

     for (int j=1; j<=i; ++j)

      cout<<5<<" ";

     cout<<endl;

    }

    }

    №1.2

    #include <iostream>

    using namespace std;

    int main(){

    for(int i=1; i<=5; ++i){

     for (int j=1; j<=i; ++j)

      cout<<i<<" ";

     cout<<endl;

    }

    }

    №1.3

    #include <iostream>

    using namespace std;

    int main(){

    for(int i=5; i>=1; --i){

     for (int j=1; j<=i; ++j)

      if (5*(6-i)==5) cout<<"5"<<"  ";

      else cout<<5*(6-i)<<" ";

     cout<<endl;

    }

    }

    №2

    #include <iostream>

    using namespace std;

    int main(){

    cout.precision(10);

    double b, x, y;

    cin>>b;

    for (double a=1; a<=7; ++a)

     for (double c=-0.5; c<=0.5; c+=0.1){

      x=(abs(a-b*c*c+c*c*c))/(12*(b*c+1));

      y=(a*a-b*x*x*x+16*c*x*x)/(x+a);

      cout<<"a="<<a<<" c="<<c<<" y="<<y<<endl;

     }

    }

    (тут в столбик выводятся все 3 переменные: a, c, y. Но тут проблема при c=0: в выводе c=-2.775557562e-17 и я не знаю как ее решить)

    №3

    #include <iostream>

    using namespace std;

    int main(){

    cout.precision(10);

    double x, y, a;

    cin>>a;

    for(double b=1.2; b<4.9; b+=0.2)

     for (double d=-1; d<=4; ++d){

      x=2*a*b*b;

      y=(x*x*x*x*x)/(d*b)+x/(2*a);

      cout<<"b="<<b<<" d="<<d<<" y="<<y<<endl;

     }

    }

    • Автор:

      heather82
    • 5 лет назад
    • 0
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years