⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 برنامه جمع عناصر ماتریس با عمل اصلی جمع قسمت الف سوال.txt

📁 add elements of matrix
💻 TXT
字号:
#include <iostream.h>
#include <conio.h>

int add(int a[20],int n)
{
       int i,j,sum=a[0],Tn=0;
       for(i=1;i<n;i++)
       {
            sum+=a[i];
            Tn++;
       }
       cout<<"T(n)="<<Tn<<"\n";
       return sum;
}


main()
{
    int a[20], i,j,n;
    cout<<"Enter the row matrix a:";
    cin>>n;
    cout<<"\n Enter the element of matrix a:\n";
    for(i=0; i<n; i++)
        {
            cout<<"\na["<<i+1<<"]:";
            cin>>a[i];
        }

    /* Displaying Matrix */
    clrscr();
    cout<<"matrix a:\n";
    for(i=0; i<n; i++)
        cout<<a[i]<<" ";
    cout<<"\n";
    cout<<"sum:"<<add(a,n);
    getch();
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -