• 0
  • مالي خلق
  • أتهاوش
  • متضايق
  • مريض
  • مستانس
  • مستغرب
  • مشتط
  • أسولف
  • مغرم
  • معصب
  • منحرج
  • آكل
  • ابكي
  • ارقص
  • اصلي
  • استهبل
  • اضحك
  • اضحك  2
  • تعجبني
  • بضبطلك
  • رايق
  • زعلان
  • عبقري
  • نايم
  • طبيعي
  • كشخة
  • النتائج 1 إلى 9 من 9

    الموضوع: مكتبه اكواد لل سي ++

    1. #1
      التسجيل
      27-02-2005
      الدولة
      قلب الرياض
      المشاركات
      134
      المواضيع
      21
      شكر / اعجاب مشاركة

      مكتبه اكواد لل سي ++

      وانا احورف بهالمنتديات اعجبتني هالفكره وهو ان كل واحد ينطل اكواد صح وبرامج نستفيد منها ونفيد غيرنا فوش رايكم

      واببدا انا اول وحده

      وهدا برنامج ملطوووووووووووووووش لكم برنامج الساعه




      #include <iostream.h>
      #include <stdio.h>
      #include <string.h>
      #include <math.h>
      #include <graphics.h>
      #include <conio.h>
      #include <time.h>
      #include <dos.h>
      #include <stdlib.h>

      #define PI 3.14159265359
      #define _2PI 2*PI

      #define IS_OK_SELECTED(x,y,button) (((x>=200)&&(x<=270)) && ((y>=418)&&(y<=443)) && ((button&1)==1))?1:0
      #define IS_CANCEL_SELECTED(x,y,button) (((x>=370)&&(x<=440)) && ((y>=418)&&(y<=443)) && ((button&1)==1))?1:0

      #define IS_HRUP_SELECTED(x,y,button) (((x>=238)&&(x<=250)) && ((y>=370)&&(y<=380)) && ((button&1)==1))?1:0
      #define IS_HRDN_SELECTED(x,y,button) (((x>=238)&&(x<=250)) && ((y>=381)&&(y<=390)) && ((button&1)==1))?1:0
      #define IS_MNUP_SELECTED(x,y,button) (((x>=303)&&(x<=315)) && ((y>=370)&&(y<=380)) && ((button&1)==1))?1:0
      #define IS_MNDN_SELECTED(x,y,button) (((x>=303)&&(x<=315)) && ((y>=381)&&(y<=390)) && ((button&1)==1))?1:0
      #define IS_SCUP_SELECTED(x,y,button) (((x>=368)&&(x<=380)) && ((y>=370)&&(y<=380)) && ((button&1)==1))?1:0
      #define IS_SCDN_SELECTED(x,y,button) (((x>=368)&&(x<=380)) && ((y>=381)&&(y<=390)) && ((button&1)==1))?1:0
      #define IS_APUP_SELECTED(x,y,button) (((x>=428)&&(x<=440)) && ((y>=370)&&(y<=380)) && ((button&1)==1))?1:0
      #define IS_APDN_SELECTED(x,y,button) (((x>=428)&&(x<=440)) && ((y>=381)&&(y<=390)) && ((button&1)==1))?1:0

      class coordinate
      {
      protected:
      int x,y; public:

      coordinate()
      {
      x=y=0;
      }

      coordinate(int initx,int inity)
      {
      x = initx;
      y = inity;
      }
      };

      class timenow
      {
      private:
      struct time tm;public:
      int tellhour(void)
      {
      gettime(&tm);
      return tm.ti_hour;
      }

      int tellminute(void)
      {
      gettime(&tm);
      return tm.ti_min;
      }

      int tellsecond(void)
      {
      gettime(&tm);
      return tm.ti_sec;
      }
      };

      class mouse
      {
      private:
      union REGS i,o;
      public:
      mouse()
      {
      initmouse();
      showmousepointer();
      setmouseptrpos(425,320);
      restrictmousepointer(1,1,630,478);
      }

      void initmouse()
      {
      i.x.ax = 0;
      int86(0x33,&i,&o);
      if(o.x.ax == 0)
      {
      cleardevice();
      closegraph();
      restorecrtmode();
      printf("\nMouse driver not installed.\nQuitting...\n");
      }
      }

      void showmousepointer()
      {
      i.x.ax = 1;
      int86(0x33,&i,&o);
      }

      void setmouseptrpos(int row, int col)
      {
      i.x.ax = 4;
      i.x.cx = col;
      i.x.dx = row;
      int86(0x33,&i,&o);
      }

      void hidemousepointer()
      {
      i.x.ax = 2;
      int86(0x33,&i,&o);
      }

      void getmousepos(int &button, int &x, int &y)
      {
      i.x.ax = 3;
      int86(0x33,&i,&o);
      button = o.x.bx;
      x = o.x.cx;
      y = o.x.dx;
      }

      void restrictmousepointer(int x1, int y1, int x2, int y2)
      {
      i.x.ax = 7;
      i.x.cx = x1;
      i.x.dx = x2;
      int86(0x33,&i,&o);
      i.x.ax = 8;
      i.x.cx = y1;
      i.x.dx = y2;
      int86(0x33,&i,&o);
      }
      };

      class textbox
      {
      public:
      textbox(int col1,int row1, int col2, int row2)
      {
      setfillstyle(SOLID_FILL,WHITE);
      bar(col1,row1,col2,row2);
      setcolor(LIGHTGRAY);
      line(col1 + 1,row2-1,col2-1,row2-1);
      line(col2-1,row1+1,col2-1,row2-1);
      setcolor(DARKGRAY);
      line(col1,row1-1,col2,row1-1);
      line(col1-1,row1-1,col1-1,row2);
      }
      };

      class BUTTON
      {
      private:
      int row1,col1,row2,col2; public:
      BUTTON()
      {
      }
      BUTTON(int col1, int row1,int col2,int row2)
      {
      this -> col1=col1;
      this -> row1=row2;
      this -> col2=col2;
      this -> row2=row2;
      setcolor(BLACK);
      rectangle(col1,row1,col2,row2);
      setcolor(WHITE);
      line(col1,row1,col2,row1);
      line(col1,row1,col1,row2);
      }

      void Select(void)
      {
      setcolor(WHITE);
      settextstyle(SANS_SERIF_FONT,0,1);
      setcolor(BLACK);
      line(this -> col1, this->row1,this->col2,this->row1);
      line(this -> col1, this->row1,this->col1,this->row2);
      setcolor(WHITE);
      line(this -> col2, this->row1,this->col2,this->row2);
      line(this -> col2, this->row2,this->col1,this->row2);
      settextstyle(DEFAULT_FONT,0,1);
      }

      void UnSelect(void)
      {
      setcolor(BLACK);
      settextstyle(SANS_SERIF_FONT,0,1);
      setcolor(WHITE);
      line(col1,row1,col2,row1);
      line(col1,row1,col1,row2);
      setcolor(BLACK);
      line(col2,row1,col2,row2);
      line(col2,row2,col1,row2);
      settextstyle(DEFAULT_FONT,0,1);
      }
      };

      class clockbodyublic coordinate
      {
      private:
      int radius; public:
      clockbody(int centreX,int centreY):coordinate(centreX,centreY)
      {
      int inner_radius;
      int i;
      setcolor(WHITE);
      settextstyle(TRIPLEX_FONT,0,1);
      outtextxy(260,82,"TIME VIEWER");
      radius = (200*8)/20;
      inner_radius = (radius*8)/10;
      setcolor(WHITE);
      circle(x,y,radius);
      setfillstyle(SOLID_FILL,LIGHTGRAY);
      floodfill(x,y,getmaxcolor());
      setcolor(WHITE);
      circle(x,y,inner_radius-5);
      setfillstyle(SOLID_FILL,WHITE);
      floodfill(x,y,getmaxcolor());
      setcolor(BLACK);
      circle(x,y,1);
      int row,col;
      char no[5];
      settextstyle(SANS_SERIF_FONT,0,1);
      radius = 70;
      settextstyle(DEFAULT_FONT,0,1);
      for(i=1;i<=12;i++)
      {
      row = (x+radius*sin(_2PI*i/12.0));
      col = (y-radius*cos(_2PI*i/12.0));
      itoa(i,no,10);
      outtextxy((row-textwidth(no)/2),(col+textheight(no)/2)-5,no);
      }

      }

      int tellradius(void)
      {
      return radius;
      }

      int tellcentreX(void)
      {
      return x;
      }

      int tellcentreY(void)
      {
      return y;
      }

      };


      void main(void)
      {
      int gd = DETECT,gm;
      int hr,min,sec,acchr;
      int button,x,y;
      char strtime[3],opt;
      struct time ot,nt;
      static char apflg;
      void frame(int,int,int,int);
      void background(int,int,int,int);
      void clockhands(int,int,int,clockbody,char);
      char *putzero(char[]);


      initgraph(&gd,&gm,"C:\\TC\\BGI");
      cleardevice();
      frame(190,125,450,350);
      frame(190,70,450,120);
      background(190,360,450,400);
      background(190,410,450,450);

      BUTTON hrup(238,370,250,380),hrdn(238,381,250,390),
      mnup(303,370,315,380),mndn(303,381,315,390),
      scup(368,370,380,380),scdn(368,381,380,390),
      apup(428,370,440,380),apdn(428,381,440,390),
      Ok(200,418,270,443),Cancel(370,418,440,443);
      setcolor(BLACK);
      outtextxy(240,371,"");outtextxy(305,371,"");
      outtextxy(370,371,"");outtextxy(430,371,"");
      outtextxy(240,382,"");outtextxy(305,382,"");
      outtextxy(370,382,"");outtextxy(430,382,"");
      outtextxy(230,428,"Ok");outtextxy(382,428,"Cancel");
      textbox hour(200,370,235,390),minute(265,370,300,390),
      second(330,370,365,390),ampm(390,370,425,390);
      clockbody clock(getmaxx()/2,getmaxy()/2);
      timenow time;
      mouse m;
      gettime(&ot);
      setcolor(WHITE);
      outtextxy(100,470,"Developed and Designed by Ranawat Mahipat Balwantraj, GCET.");

      while(1)
      {
      hr = time.tellhour();
      min = time.tellminute();
      sec = time.tellsecond();

      if(hr>=12)
      apflg = 'p';
      if(hr < 12)
      apflg = 'a';

      m.getmousepos(button,x,y);

      if(IS_OK_SELECTED(x,y,button))
      {
      while(IS_OK_SELECTED(x,y,button))
      {
      Ok.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(230,428,"Ok");
      }

      Ok.UnSelect();
      setcolor(BLACK);
      outtextxy(230,428,"Ok");
      gettime(&nt);
      if(nt.ti_hour==0)
      nt.ti_hour=12;
      settime(&nt);
      break;
      }

      if(IS_CANCEL_SELECTED(x,y,button))
      {
      while(IS_CANCEL_SELECTED(x,y,button))
      {
      Cancel.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(382,428,"Cancel");
      }
      Cancel.UnSelect();
      setcolor(BLACK);
      outtextxy(382,428,"Cancel");
      settime(&ot);
      break;
      }

      if(IS_HRUP_SELECTED(x,y,button))
      {
      gettime(&nt);
      while(IS_HRUP_SELECTED(x,y,button))
      {
      hrup.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(240,371,"");
      }
      hrup.UnSelect();
      nt.ti_hour++;
      if(nt.ti_hour>23)
      nt.ti_hour = 12;
      else if(nt.ti_hour > 11 && nt.ti_hour < 13)
      nt.ti_hour = 0;
      settime(&nt);
      hr = time.tellhour();
      setcolor(BLACK);
      outtextxy(240,371,"");
      }

      if(IS_HRDN_SELECTED(x,y,button))
      {
      gettime(&nt);
      while(IS_HRDN_SELECTED(x,y,button))
      {
      hrdn.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(240,382,"");
      }
      hrdn.UnSelect();
      if(nt.ti_hour < 1 && apflg == 'a')
      nt.ti_hour = 12;
      nt.ti_hour--;
      if(nt.ti_hour < 12 && apflg == 'p')
      nt.ti_hour = 23;
      else if(nt.ti_hour < 1 && apflg =='a')
      nt.ti_hour = 0;
      settime(&nt);
      hr = time.tellhour();
      setcolor(BLACK);
      outtextxy(240,382,"");
      }

      if(IS_MNUP_SELECTED(x,y,button))
      {
      gettime(&nt);
      while(IS_MNUP_SELECTED(x,y,button))
      {
      mnup.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(305,371,"");
      }
      mnup.UnSelect();
      nt.ti_min++;
      if(nt.ti_min > 59)
      nt.ti_min = 0;
      min = time.tellminute();
      settime(&nt);
      setcolor(BLACK);
      outtextxy(305,371,"");
      }

      if(IS_MNDN_SELECTED(x,y,button))
      {
      gettime(&nt);

      while(IS_MNDN_SELECTED(x,y,button))
      {
      mndn.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(305,382,"");
      }
      mndn.UnSelect();
      nt.ti_min--;
      if(nt.ti_min == 0)
      nt.ti_min = 59;
      settime(&nt);
      min = time.tellminute();
      setcolor(BLACK);
      outtextxy(305,382,"");
      }


      if(IS_SCUP_SELECTED(x,y,button))
      {
      gettime(&nt);

      while(IS_SCUP_SELECTED(x,y,button))
      {
      scup.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(370,371,"");
      }

      scup.UnSelect();
      nt.ti_sec++;

      if(nt.ti_sec > 59)
      nt.ti_sec = 0;

      settime(&nt);
      sec = time.tellsecond();
      setcolor(BLACK);
      outtextxy(370,371,"");
      }

      if(IS_SCDN_SELECTED(x,y,button))
      {
      gettime(&nt);
      while(IS_SCDN_SELECTED(x,y,button))
      {
      scdn.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(307,382,"");
      }
      scdn.UnSelect();
      nt.ti_sec--;
      if(nt.ti_sec == 0)
      nt.ti_sec = 59;
      min = time.tellminute();
      settime(&nt);
      sec = time.tellminute();
      setcolor(BLACK);
      outtextxy(305,382,"");
      }

      if(IS_APUP_SELECTED(x,y,button))
      {
      gettime(&nt);
      while(IS_APUP_SELECTED(x,y,button))
      {
      apup.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(430,371,"");
      }
      apup.UnSelect();
      setcolor(BLACK);
      outtextxy(430,371,"");
      switch(apflg)
      {
      case 'a': nt.ti_hour += 12;
      settime(&nt);
      break;
      case 'p': nt.ti_hour -= 12;
      settime(&nt);
      break;
      }
      settime(&nt);
      }

      if(IS_APDN_SELECTED(x,y,button))
      {
      gettime(&nt);
      while(IS_APDN_SELECTED(x,y,button))
      {
      apdn.Select();
      m.getmousepos(button,x,y);
      setcolor(WHITE);
      outtextxy(430,382,"");
      }
      apdn.UnSelect();
      setcolor(BLACK);
      outtextxy(430,382,"");
      switch(apflg)
      {
      case 'a': nt.ti_hour += 12;
      settime(&nt);
      break;
      case 'p': nt.ti_hour -= 12;
      settime(&nt);
      break;
      }
      settime(&nt);
      }


      setcolor(BLACK);
      if(hr == 0)
      acchr = 12;
      else if(hr>12)
      acchr = hr-12;
      else
      acchr = hr;

      if(hr>=12)
      setcolor(WHITE),outtextxy(400,375,"AM"),
      setcolor(BLACK),outtextxy(400,375,"PM"),
      apflg = 'p';

      else
      setcolor(WHITE),outtextxy(400,375,"PM"),
      setcolor(BLACK),outtextxy(400,375,"AM"),
      apflg = 'a';

      outtextxy(210,375,putzero(itoa(acchr,strtime,10)));
      outtextxy(275,375,putzero(itoa(min,strtime,10)));
      outtextxy(340,375,putzero(itoa(sec,strtime,10)));
      opt='n';
      clockhands(hr,min,sec,clock,opt);
      delay(50);
      setcolor(WHITE);
      outtextxy(210,375,putzero(itoa(acchr,strtime,10)));
      outtextxy(275,375,putzero(itoa(min,strtime,10)));
      outtextxy(340,375,putzero(itoa(sec,strtime,10)));
      opt = 'y';
      clockhands(hr,min,sec,clock,opt);
      }

      closegraph();
      restorecrtmode();
      }

      char* putzero(char strtime[])
      {
      if(strlen(strtime) == 1)
      {
      strtime[1] = strtime[0];
      strtime[0] = '0';
      strtime[2] = '\0';
      }
      return strtime;
      }


      void clockhands(int h, int m,int s,clockbody clock,char opt)
      {
      int x = clock.tellcentreX();
      int y = clock.tellcentreY();
      int r = clock.tellradius();
      int h_len = (r*5)/10;
      int m_len = (r*7)/10;
      int s_len = (r*6)/10;

      double hour_value = h+m/60.0 + s/3600.00;
      hour_value *= _2PI/12.0;
      if(opt!='y')
      setcolor(BLACK);
      setlinestyle(0,0,3);
      line(x,y,(int)(x+h_len*sin(hour_value)),(int)(y-h_len*cos(hour_value)));
      line(x,y+1,(int)(x+h_len*sin(hour_value)),(int)(y-h_len*cos(hour_value))+1);

      double minute_value = m+ s/60.0;
      minute_value *= _2PI/60.0;
      if(opt!='y')
      setcolor(BLACK);
      setlinestyle(0,0,3);
      line(x,y,(int)(x+m_len*sin(minute_value)),(int)(y-m_len*cos(minute_value)));
      line(x,y+1,(int)(x+m_len*sin(minute_value)),(int)(y-m_len*cos(minute_value))+1);

      double second_value = s*_2PI/60.0;
      minute_value *= _2PI/60.0;
      if(opt!='y')
      setcolor(BLACK);
      setlinestyle(0,0,1);
      line(x,y,(int)(x+s_len*sin(second_value)),(int)(y-s_len*cos(second_value)));
      }



      void background(int c1,int r1, int c2, int r2)
      {
      setfillstyle(SOLID_FILL,LIGHTGRAY);
      bar(c1,r1,c2,r2);
      setcolor(WHITE);
      line(c1,r1,c2,r1);
      line(c1,r1+1,c2,r1+1);
      line(c2,r1,c2,r2);
      line(c2-1,r1,c2-1,r2);
      setcolor(DARKGRAY);
      line(c1,r1,c1,r2);
      line(c1+1,r1,c1+1,r2);
      line(c1,r2,c2,r2);
      line(c1,r2-1,c2,r2-1);
      }

      void frame(int c1,int r1,int c2,int r2)
      {
      setfillstyle(SOLID_FILL,LIGHTGRAY);
      bar(c1,r1,c2,r2);
      setcolor(WHITE);
      setfillstyle(SOLID_FILL,BLACK);
      bar(c1+15,r1+15,c2-15,r2-15);
      setcolor(WHITE);
      line(c1,r1,c2,r1);
      line(c1,r1+1,c2,r1+1);
      line(c2,r1,c2-1,r2);
      line(c1+15,r1+15,c1+15,r2-15);
      line(c1+15,r2-15,c2-15,r2-15);
      line((c1+15)-1,r1+15,(c1+15)-1,r2-15);
      line((c1+15)-1,(r2-15)+1,c2-15,(r2-15)+1);
      setcolor(DARKGRAY);
      line(c1+15,(r1+15)-1,c2-15,(r1+15)-1);
      line(c1+15,(r1+15)-2,c2-15,(r1+15)-2);
      line(c1,r1,c1,r2);
      line(c1+1,r1,c1+1,r2);
      line(c1,r2,c2,r2);
      line(c1+1,r2-1,c2,r2-1);
      }
      مااعرف اسوي توقيع قمت ورسمته ..... اش رايكم؟؟

    2. #2
      التسجيل
      27-02-2005
      الدولة
      قلب الرياض
      المشاركات
      134
      المواضيع
      21
      شكر / اعجاب مشاركة

      مشاركة: مكتبه اكواد لل سي ++

      وهذا كود يعطيك التاريخ اللي احنا فيه اليوم



      #include<iostream>

      #include<ctime>

      using namespace std;



      // a small program that demonstrates how to get a system date

      main()

      {

      struct tm* local;

      time_t t;

      t= time (NULL);

      local = localtime (&t);

      int day= local->tm_mday;

      int month= local->tm_mon+1;

      int year = local->tm_year+1900;





      cout<< day<<"/"<<month<<"/"<<year<<endl;

      return 0;

      }

      مااعرف اسوي توقيع قمت ورسمته ..... اش رايكم؟؟

    3. #3
      التسجيل
      30-12-2004
      المشاركات
      449
      المواضيع
      12
      شكر / اعجاب مشاركة

      مشاركة: مكتبه اكواد لل سي ++

      جميل!

      شخصيا انا فخور بك. بنات امريكا يخشين التكنولوجيا وتجدهن تتفادين كل ما يمت لها بصلة. للاسف الشديد.

    4. #4
      التسجيل
      08-09-2004
      الدولة
      Jeddah/KSA
      المشاركات
      9,942
      المواضيع
      532
      شكر / اعجاب مشاركة

      مشاركة: مكتبه اكواد لل سي ++

      مشكووووره على هذه الاكواد والصراحة انا لسة جديد في البرمجة بس انشالله اجربها !!

    5. #5
      التسجيل
      09-07-2004
      المشاركات
      55
      المواضيع
      9
      شكر / اعجاب مشاركة

      مشاركة: مكتبه اكواد لل سي ++

      يعطيك العافية اخوي ماتقصر ... ماشاءالله كل الأكواد الي نحتاجها وبنحتاجها موجودة !!! شكرا جزيلاً وتسلم ..

    6. #6
      التسجيل
      27-02-2005
      الدولة
      قلب الرياض
      المشاركات
      134
      المواضيع
      21
      شكر / اعجاب مشاركة

      مشاركة: مكتبه اكواد لل سي ++

      ibn_alqalam مشكووووووووور اخوي مثل ماتفتخر فينا نفتخر احنا برجالنا

      كاسح الالعاب::هلا فيك اخوي البرمجه سهله بس يبي لها مخ رايق وانشالله تستفيد مننا ونستفيد منك

      get_crazy17 اولا انا بنت ثانيا العفو

      _____________________________________________
      اكواد جديده

      لإيجاد وتر المثلت ذي الزاوية القائمة


      #include <iostream.h>
      #include <math.h>
      #define PI 3.14
      main()
      {
      float hypotenuse ,opposite ,adjacent ,angle ;
      cout << "Please enter the hypotenuse : " ;
      cin >> hypotenuse ;
      cout << "Please enter the angle in degrees : " ;
      cin >> angle ;
      opposite = hypotenuse *sin(angle*PI/180) ;
      adjacent = hypotenuse *cos(angle*PI/180) ;
      cout << "The length of opposite side = " <<opposite ;
      cout << "\nThe length of adjacent side = " <<adjacent ;
      }


      مااعرف اسوي توقيع قمت ورسمته ..... اش رايكم؟؟

    7. #7
      التسجيل
      27-02-2005
      الدولة
      قلب الرياض
      المشاركات
      134
      المواضيع
      21
      شكر / اعجاب مشاركة

      مشاركة: مكتبه اكواد لل سي ++

      برنامج ايجاد المصفوفه الثانيه


      #include <iostream.h>
      main()
      {
      float a[2][3], b[2][3] ;
      int i, j ;
      cout << "\n \a Please enter the elements: " ;
      for(i=0; i<2; i++)
      for(j=0; j<3; j++)
      {
      cout << "\n A[ "<< i+1<< " , "<< j+1 << " ] = " ;
      cin >> a[j] ;
      cout << "\t B[ "<< i+1<< " , "<< j+1 << " ] = " ;
      cin >> b[j] ;
      }
      for(i=0; i<2; i++)
      {
      for(j=0; j<3; j++)
      cout << a[j]+b[j] << "\t" ;
      cout << '\n' ;
      }
      }


      مااعرف اسوي توقيع قمت ورسمته ..... اش رايكم؟؟

    8. #8
      التسجيل
      27-02-2005
      الدولة
      قلب الرياض
      المشاركات
      134
      المواضيع
      21
      شكر / اعجاب مشاركة

      مشاركة: مكتبه اكواد لل سي ++

      برنامج تعطية إحداثياث عمودين في الرسم البياني ويعطيك ما إذا كانا متوازيان أو متقاطعان في نقطة يقوم بذكر تلك النقطة


      #include <iostream.h>
      #include <math.h>
      main()
      {
      float a1, a2, b1, b2, c1, c2, d, d_x, d_y, x, y ;
      cout << "\nEnter the cofactor of the first line " ;
      cin >> a1>> b1>> c1 ;
      cout << "\nEnter the cofactor of the second line " ;
      cin >> a2>> b2>> c2 ;
      d = (a1*b2) - (a2*b1) ;
      d_x = (c1*b2) - (c2*b1) ;
      d_y = (a1*c2) - (a2*c1) ;

      if(d==0)
      cout << "\nThis two lines are parallel " ;
      else
      {
      x = d_x / d ;
      y = d_y / d ;
      cout << "\nThe intersection point of your lines are "<< x<<","<< y<<")" ;
      }
      }

      مااعرف اسوي توقيع قمت ورسمته ..... اش رايكم؟؟

    9. #9
      التسجيل
      27-02-2005
      الدولة
      قلب الرياض
      المشاركات
      134
      المواضيع
      21
      شكر / اعجاب مشاركة

      مشاركة: مكتبه اكواد لل سي ++

      برنامج حسابات مستشفى

      #include <iostream.h>
      #include <conio.h>
      main()
      {
      int n ;
      char request ;
      float sc, mc, misc, dayc, id, total, total_id, total_md ;

      begin: clrscr() ;
      cout << "\n\nPlease enter Number of days the patient set in hospital : " ;
      cin >> n ;
      cout << "Please enter Surgery coast : " ;
      cin >> sc ;
      cout << "Please enter Medication coast : " ;
      cin >> mc ;
      cout << "Please enter Miscellaneous coast : " ;
      cin >> misc ;
      cout << "Please enter Coast in hospital per day : " ;
      cin >> dayc ;
      cout << "Please enter Insurance deductible : " ;
      cin >> id ;

      total = (dayc* n) + sc + mc + misc + id ;
      cout << "Total coast : " << total ;

      total_id = total - id ;
      cout << "\nTotal coast LESS Insurance deductible : " << total_id ;

      total_md = total - mc ;
      cout << "\nTotal coast LESS Medication & deductible : " << total_md ;

      cout << "\nDo you have another patient (Y/N) : " ;
      cin >> request ;
      if(request=='y') goto begin ;
      }
      مااعرف اسوي توقيع قمت ورسمته ..... اش رايكم؟؟

    ضوابط المشاركة

    • لا تستطيع إضافة مواضيع جديدة
    • لا تستطيع الرد على المواضيع
    • لا تستطيع إرفاق ملفات
    • لا تستطيع تعديل مشاركاتك
    •