مشاهده نسخه کامل
: سوال ++C
mmmttmmm
21-12-2015, 18:46
سلام
من تازه برنامه نویسی رو شروع کردم
میخوام با ++C برنامه ای بنویسم که دو ماتریس بگیره (با اندازه دلخواه)و روی اون ضرب جمع تفریق انجام بده
چه طوری می تونم دوتا ماتریس رو ضرب کنم
لطفا کمک کنید
norooz1345
21-12-2015, 23:05
سلام
من تازه برنامه نویسی رو شروع کردم
میخوام با ++C برنامه ای بنویسم که دو ماتریس بگیره (با اندازه دلخواه)و روی اون ضرب جمع تفریق انجام بده
چه طوری می تونم دوتا ماتریس رو ضرب کنم
لطفا کمک کنید
سلام این دستور جمع دو ماتریس (برای تفریق میشه استفاده بشه)میتونی برنامه رو جمع جور تر هم بنویسی ،دستور چاپ هم به برنامت اضافه کن آخر .
برای مشاهده محتوا ، لطفا وارد شوید یا ثبت نام کنید
fatemetavakoli
14-01-2016, 21:15
سلام برنامه من سرتایر ارورر هست چیکار کنم
#include ([ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]) <iostream>
#include ([ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]) <stdlib.h>
#include ([ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]) <conio.h>
#include ([ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]) <math.h>
using namespace std;
void dismenu();
void dismenu();
int main();
//------------------------------------------------ DEFINE STRUCT CLASS --------
struct student
{
private:
int ID;
int avg;
char name[10];
char family[10];
public:
static int count;
char flag;
student();
void insert();
void search_by_ID();
void search_by_Name();
void search_by_Family();
void show_by_Avg();
void show_by_Name();
void insert_code_dars();
void show();
void delet();
void reslt_serch(int);
void gotoxy(int ,int );
};
student object[40];
int student::count;
//----------------------------------------------------------- MAIN -------------
int main()
{
int key, number;
student obj;
cout<<" ****************************\n";
cout<<" * BOZORGI - *\n";
cout<<" ****************************\n";
cout<<"\n Please Insert number of Student's in class: ";
cin>>number;
start:
system("cls");
dismenu();
cout<<"\n Please select one item from (1-8).";
cin>>key;
switch(key)
{
case 1:
obj.insert();
break;
case 2:
obj.search_by_ID();
break;
case 3:
obj.search_by_Name();
break;
case 4:
obj.search_by_Family();
break;
case 5:
obj.show_by_Avg();
break;
case 6:
obj.show_by_Name();
break;
case 7:
obj.delet();
break;
case 8:
exit(0);
break;
default:
textcolor(12);
cprintf("\n Your choice is mistake.");
break;
}
getch();
goto start;
}
//---------------------------------------------------------------- DISMENU -----
void dismenu()
{
cout<<" ****************************\n";
cout<<" * BOZORGI - *\n";
cout<<" ****************************\n";
textcolor(10);
cprintf("****** Student Information ********\n");
cout<<"\n***********************************";
cout<<"\n 1) Insert Student. *";
cout<<"\n----------------------------------*";
cout<<"\n 2) insert doros. *";
cout<<"\n----------------------------------";
cout<<"\n 3) Show by ID . *";
cout<<"\n----------------------------------*";
cout<<"\n 4) Delete dars. *";
cout<<"\n----------------------------------*";
cout<<"\n 5) Exit. *";
cout<<"\n***********************************";
}
//-------------------------------------------------------- CONSTRUCT STUDENT ---
student::student()
{
flag='F';
}
//------------------------------------------------------------ INSERT ----------
void student::insert()
{
student ob;
clrscr();
textcolor(10);
cprintf("******************************");
cout<<endl;
cprintf("* ID : *");
cout<<endl;
cprintf("******************************");
cout<<endl;
cprintf("* Name : *");
cout<<endl;
cprintf("******************************");
cout<<endl;
cprintf("* Family : *");
cout<<endl;
cprintf("******************************");
cout<<endl;
cprintf("* Average : *");
cout<<endl;
cprintf("******************************");
gotoxy(13,2);
cin>>object[ob.count].ID;
gotoxy(13,4);
cin>>object[ob.count].name;
gotoxy(13,6);
cin>>object[ob.count].family;
gotoxy(13,8);
cin>>object[ob.count].avg;
ob.count++;
}
//------------------------------------------------------------ INSERT doros ----------
void student::insert doros()
{
student ob;
clrscr();
textcolor(10);
cprintf("******************************");
cout<<endl;
cprintf("* code dars : *");
cout<<endl;
cprintf("******************************");
cout<<endl;
cprintf("* Name dars : *");
cout<<endl;
cprintf("******************************");
cout<<endl;
cprintf("* nam ostad : *");
cout<<endl;
cprintf("******************************");
cout<<endl;
gotoxy(13,2);
cin>>object[ob.count].code dars;
gotoxy(13,4);
cin>>object[ob.count].name dars;
gotoxy(13,6);
cin>>object[ob.count].nam ostad;
ob.count++;
}
//------------------------------------------------------- SEARCH BY ID----------
void student::search_by_ID()
{
int i,num;
student ob;
clrscr();
if(ob.count==0)
{
gotoxy(2,2);
textcolor(12);
cprintf("The class is empty!!!");
}
else
{
cout<<"\nEnter ID of student for search: ";
cin>>num;
for(i=0; i<ob.count; i++)
{
if(object[i].ID==num)
{
ob.flag='T';
textcolor(10);
cprintf("This Student exist in class.");
cout<<endl;
cprintf("------------------------------------------------------");
cout<<endl;
cprintf("|Radif| ID | Name | Family | Average |");
cout<<endl;
cprintf("------------------------------------------------------");
cout<<endl;
ob.reslt_serch(i);//call student::void reslt_serch(i)
cout<<endl;
cprintf("------------------------------------------------------");
}
}
if(ob.flag=='F')
{
gotoxy(2,2);
textcolor(12);
cprintf("\nYour Student not exist in class!!!");
}
}
}
//-------------------------------------------------------- dars::DELETE -----
void student::delet()
{
int i,num;
flag='F';
clrscr();
if (count==0)
{
gotoxy(2,2);
textcolor(12);
cprintf("The class is empty!!!");
}
else
{
cout<<" Enter ID of Student for delete: ";
cin>>num;
for(i=0; i<count; i++)
{
if(object[i].ID==num)
{
flag='T';
show();//call void show()
gotoxy(1,1);
cout<<" Enter code of dars for delete: "<<num;
getch();
object[i].code dars=0;
object[i].name dars[0]='\0';
object[i].nam ostad[0]='\0';
show();
textcolor(12);
gotoxy(2,15);
cprintf("Delete Student from class.");
}
}
if(flag=='F')
{
gotoxy(2,2);
textcolor(12);
cprintf("\nYour Student not exist in class for delete.!!!");
}
}
}
//------------------------------------------------------------ SHOW ------------
void student::show()
{
int i,row=5;
student ob;
clrscr();
textcolor(10);
cout<<endl;
cprintf("------------------------------------------------------------");
cout<<endl;
cprintf("|Radif| ID | Name | Family | Average |");
cout<<endl;
cprintf("------------------------------------------------------------");
cout<<endl;
if(ob.count==0)
{
textcolor(12);
cprintf(" Null Null Null Null Null ");
}
for(i=0; i<ob.count; i++)
{
gotoxy(3,row);
cout<<++i;
i--;
if(object[i].ID!=0)
{
gotoxy(11,row);
cout<<object[i].ID;
gotoxy(23,row);
cout<<object[i].name;
gotoxy(37,row);
cout<<object[i].family;
gotoxy(55,row);
cout<<object[i].avg;
cout<<endl;
textcolor(10);
cprintf("------------------------------------------------------------");
cout<<endl;
row=row+2;
}
}
}
[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ] dev
mehrab800
24-06-2016, 17:39
[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ] dev
سلام من ی مشکل دارم برای نوشتن دوتا بذنامه با dev++
اولیش ی شکل گوشه صفحه رسم بشه و 90 درجه بچرخه درصورتی ک هر شکلی خودم بکشم بازم بچرخه با استفاده از فرمول cin وcos و با لاین یا putpixel طراحی بشه چون نباید از دستورات پیشرفته استفاده کنیم
دومیش یک توپ از گوشه صفحه حرکت کنه و یک خط ب صورت تصادفی پایین صفحه ایجاد بشه اگر توپ تا پایین اومد ب خط خورد با زاویه 45 ب سمت بالا برگرده و اگر نخورد از صفحه خارج بشه توپ با تابع های circle یا ellips
لطفا لطفا کمک
بگو کلا برات برنامه رو بنویسن دوستان تحویل بدن دیگه.
دبگه احتیاجی ندارم خودم حلش کردم برا دوتاش ب مشکل برخورده بودم ک گذاشتمش اشتباهم این بود ک بیس برنامرو نذاشتم خطاهاشوبخوام ببینم کسی بلده یا نه بهرحال ک حل شد تموم شد از لطفتونم تشکر
بگو کلا برات برنامه رو بنویسن دوستان تحویل بدن دیگه.
- - - Updated - - -
باید کداشو قرار میدادم ک ندادم
mehrab800
26-06-2016, 03:32
دبگه احتیاجی ندارم خودم حلش کردم برا دوتاش ب مشکل برخورده بودم ک گذاشتمش اشتباهم این بود ک بیس برنامرو نذاشتم خطاهاشوبخوام ببینم کسی بلده یا نه بهرحال ک حل شد تموم شد از لطفتونم تشکر
- - - Updated - - -
باید کداشو قرار میدادم ک ندادم
شما چیزی نگفتی ما برداشت بد کردیم
خواهش می کنم
vBulletin , Copyright ©2000-2025, Jelsoft Enterprises Ltd.