№1 задачГо
#include <iostream.h>
#include <conio.h>
main ()
{ clrscr();
int mas [100],M[100],k=0,l=999,n,i,s=1;
int sum=0;
cout<<"write amount elements of masiv :";
cin>>n;
cout<<"please,write this elements :\n";
for (i=1;i<=n;i++) cin >> mas[i];cout<<"YOUR masiv\n";
for (i=1;i<=n;i++) cout<<" "<<mas[i];
for (i=1;i<=n;i++)
if (mas[i]<0)
{sum+=mas[i];}
cout<<"\n"<<"sum of the negative elements = "<<sum;
k=mas[1];
int f=1;
for (i=1;i<=n;i++)
if (mas[i]>k)
{k=mas[i];
f=i;}
int g=1;
for (i=1;i<=n;i++)
if (mas[i]<l)
{l=mas[i];
g=i;}
if (g>f)
{for (i=f;i<=g;i++)
s*=mas[i];
cout<<"\n Multiplication of the elements between max and min = "<<s; }
if (f>g)
{for (i=g;i<=f;i++)
s*=mas[i];
cout<<"\n Multiplication of the elements between min and max = "<<s; }
getch();
return 0;
}
№2 задачГо
#include <iostream.h>
#include <conio.h>
void main()
{clrscr();
int i,j,s,q;
do
{
cout<<"write first - ";
cin>>i;
cout<<"write second - ";
cin>>j;
s=i+j;
cout<<"result = "<<s<<"\n";
cout<<"Are you whant to restart this operation?\n";
cout<<"If you WANT, push- 1, if NO, push what you want\n";
cin>>q;
}
while (q==1) ;
cout<<"Good-bye)))";
getch();
}