Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 3.1 #include <iostream>
- using namespace std;
- int main()
- {int a,b,c;
- cout<<"a"<<endl;
- cin>>a;
- cout<<"b"<<endl;
- cin>>b;
- cout<<"c"<<endl;
- cin>>c;
- float d;
- d=b*b-(4*a*c);
- if (d>0)
- cout<<"имеет 2 решения"<<endl;
- if (d=0)
- cout << "имеет 1 решение"<<endl;
- else
- cout <<"не имеет решение"<<endl;
- return 0;
- }
- 3.2 #include <iostream>
- using namespace std;
- int main()
- {
- int a, b;
- cout << "Ведите числа"<< endl;
- cin >> a;
- cin >> b;
- if (a > b)
- cout <<"Max is "<< a <<endl;
- if (a==b)
- cout <<"Числа равны"<< endl;
- else
- cout << "Max is "<< b << endl;
- return (0);
- }
- 3.3 #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c,d;
- cout<<"a"<<endl;
- cin>>a;
- cout<<"b"<<endl;
- cin>>b;
- cout<<"c"<<endl;
- cin>>c;
- cout<<"d"<<endl;
- cin>>d;
- if (a<b&&a<c&&a<d)
- cout<<"min is "<< a <<endl;
- if (a>b&&b<c&&b<d)
- cout<< "min is "<< b <<endl;
- if (c<a&&c<b&&c<d)
- cout<<"min is "<< c <<endl;
- if(d<a&&d<b&&d<c)
- cout<<"min is "<< d <<endl;
- return (0);
- }
- 3.4
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(0, "");
- int i, j;
- int summa=0 ;
- cout << "Введите первое число: "<<endl;
- cin >> i;
- cout << "Введите второе число: "<<endl;
- cin >> j;
- for (i; i<=j; i++) {
- summa = summa + i*i;
- }
- cout << summa <<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment