العفو يا صديقي سامح و لا تعصب
يمكن انا ما عرفت انسخ البرنامج من عندي للقريه لانو البرنامج هو نتيجة تصميم c++
مو مشكلة راح انزل الكود يلي كان مسودة عشان البرنامج
و اذا بتحط الكود ببرنامج c++ انشالله راح يشتغل
على فكرة البرنامج عندي شغال
بس يمكن البرنامج ما راح يشتغل الا على الجهاز يلي تصمم عليه يعني بس عندي
مو مشكلة هذا هو الكود لمن احب ان يعدل او يستزيد
لا تنسو تغيرو جهت الكتابه بعد النسخ حتى تصير من اليسار لليمين
//العمليات على المصفوفات يجمع و يطرح و يضرب بعددو يضرب مصفوفتين بدون تابع
#include<iostream>
using namespace std;
int main(){
cout<<"THANK YOU FOR USING MY PROGRRAM \nto any question
mah_41*************\n\n\n";
char z='y';
while(z!='n'){
int x1,y1,x2,y2;
cout<<"enter the dimension of first array\n";
cin>>x1>>y1;
cout<<"=============\nenter the elements of first array\n";
int a[200][200],b[200][200],c[200][200],v[200][200],i,j;
for(i=0;i<x1;i++){
for(j=0;j<y1;j++){
cin>>a[i][j];
}
}
cout<<"=============\nenter the dimension of second array\n";
cin>>x2>>y2;
cout<<"==============\nenter the elements of second array\n";
for(i=0;i<x2;i++){
for(j=0;j<y2;j++){
cin>>b[i][j];
}
}
cout<<"======================================\nthe first array is\n";
for(i=0;i<x1;i++)
{
for(j=0;j<y1;j++){
cout<<a[i][j]<<"\t";
}cout<<endl;
}
cout<<"======================================\nthe second array is\n";
for(i=0;i<x2;i++)
{
for(j=0;j<y2;j++){
cout<<b[i][j]<<"\t";
}cout<<endl;
}
if(x1==x2 && y1==y2){
cout<<"======================================\nthe addition of the two arrays is\n";
for(i=0;i<x1;i++){
for(j=0;j<y1;j++){
c[i][j]=a[i][j]+b[i][j];
cout<<c[i][j]<<"\t";
}cout<<endl;
}
cout<<"======================================\nthe subtraction of the two arrays is\n";
for(i=0;i<x1;i++){
for(j=0;j<y2;j++){
c[i][j]=a[i][j]-b[i][j];
cout<<c[i][j]<<"\t";
}cout<<endl;
}
}
else
cout<<" the arrays aren't equal in dimensions \n";
int w=0;
cout<<"=========================================== ======\n";
if (y1==x2){
for(int f=0;f<x1;f++){
for(int s=0;s<y2;s++){
for(int k=0;k<y1;k++){
w=a[f][k]*b[k][s]+w;
}
v[f][s]=w;
w=0;
}
}
}
if(y1==x2){
for (int t=0;t<x1;t++){
for (int t1=0;t1<y2;t1++){
cout <<v[t][t1]<<"\t";
}cout <<endl;
}
}
else cout<<"impossible multiplication \n================================================ =\n\n";
cout<<"do you want to calculiate other arrays (y/n)\n";
cin>>z;
}
return 0;
}
نسخ
لصق
اف 7
كنترول اف 5
و سلام