Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  iki
Language: C/C++
Code:
#include<iostream>
using namespace std;
int main ()
{
    int t[100][100],n,m,pneg=1,nrpoz=0;
    cin>>n>>m;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            cin>>t[i][j];
            if(t[i][j]>0) nrpoz++;
            else if(t[i][j]<0) pneg=pneg*t[i][j];
        }
    int c;
    cin>>c;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(t[i][j]==0) t[i][j]=c;
    cout<<nrpoz<<" "<<pneg<<"\n";
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
            cout<<t[i][j]<<" ";
        cout<<"\n";
    }
    return 0;
}
Comments: