Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math.h>
- #include <iostream>
- using namespace std;
- int main()
- {
- int mas[10];
- int n = 10;
- int sum = 0, i = 0, pow = 1;
- for (int i = 0; i < n; i++)
- {
- printf("mas[%d]=> ", i);
- scanf("%d", &mas[i]);
- if (i % 2 == 0)
- {
- sum += mas[i];
- pow *= mas[i];
- }
- }
- cout<<"Massiv"<<endl;
- for(int i = 0;i<10;i++){
- cout<<mas[i]<<" ";
- }
- cout<<endl;
- printf("Summa = %d", sum);
- cout<<endl;
- printf("proizvedenie = %d", pow);
- cout<<"Zanulit"<<endl;
- int x;
- cin>>x;
- cout<<"New massiv: "<<endl;
- for(int i = 0;i<10;i++){
- if(mas[i]==x){
- mas[i]=0;
- }
- cout<<mas[i]<<" ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement