ElenaMednikova

Untitled

Oct 21st, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. 3.1 #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {int a,b,c;
  6. cout<<"a"<<endl;
  7. cin>>a;
  8. cout<<"b"<<endl;
  9. cin>>b;
  10. cout<<"c"<<endl;
  11. cin>>c;
  12. float d;
  13. d=b*b-(4*a*c);
  14. if (d>0)
  15. cout<<"имеет 2 решения"<<endl;
  16. if (d=0)
  17. cout << "имеет 1 решение"<<endl;
  18. else
  19. cout <<"не имеет решение"<<endl;
  20.  
  21. return 0;
  22. }
  23.  
  24. 3.2 #include <iostream>
  25. using namespace std;
  26. int main()
  27. {
  28. int a, b;
  29.  
  30. cout << "Ведите числа"<< endl;
  31. cin >> a;
  32. cin >> b;
  33. if (a > b)
  34. cout <<"Max is "<< a <<endl;
  35. if (a==b)
  36. cout <<"Числа равны"<< endl;
  37. else
  38. cout << "Max is "<< b << endl;
  39. return (0);
  40. }
  41. 3.3 #include <iostream>
  42. using namespace std;
  43. int main()
  44. {
  45. int a,b,c,d;
  46. cout<<"a"<<endl;
  47. cin>>a;
  48. cout<<"b"<<endl;
  49. cin>>b;
  50. cout<<"c"<<endl;
  51. cin>>c;
  52. cout<<"d"<<endl;
  53. cin>>d;
  54. if (a<b&&a<c&&a<d)
  55. cout<<"min is "<< a <<endl;
  56. if (a>b&&b<c&&b<d)
  57. cout<< "min is "<< b <<endl;
  58. if (c<a&&c<b&&c<d)
  59. cout<<"min is "<< c <<endl;
  60. if(d<a&&d<b&&d<c)
  61. cout<<"min is "<< d <<endl;
  62. return (0);
  63. }
  64. 3.4
  65. #include <iostream>
  66. using namespace std;
  67. int main()
  68. {
  69. setlocale(0, "");
  70. int i, j;
  71. int summa=0 ;
  72. cout << "Введите первое число: "<<endl;
  73. cin >> i;
  74. cout << "Введите второе число: "<<endl;
  75. cin >> j;
  76. for (i; i<=j; i++) {
  77. summa = summa + i*i;
  78. }
  79. cout << summa <<endl;
  80. return 0;
  81. }
Add Comment
Please, Sign In to add comment