Results 1 to 3 of 3

Thread: ++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    =D BOdyROck's Avatar
    Join Date: Sep:2008
    Location: In My Mind
    Posts: 133

    ++

    : 1. . .
    (-) Print "+", "-", "|", " ".
    : "-" "|". .. 5x3


    ..
    #include <iostream>
    #include <cstdlib>

    using namespace std;

    class Rectangle

    {
    public:
    double a;
    double b;

    void print ();
    };

    void Rectangle::print ()
    {
    //otpe4atvane na gorna linia
    cout << "+";
    for (int i=0; i<a; i++) cout << "-";
    cout << "+";
    cout << endl;

    //otpe4atvane na...
    cout << "|";
    for (int i=0;i<a; i++) cout << " ";
    cout <<"|";
    cout<< endl;
    {
    cout << "|";
    for (int j=0;j<b;j++)
    cout << "|" << endl;


    }

    cout << "|";
    cout << endl;

    //otpe4atvane na dolna linia
    {
    cout << "+";
    for (int i=0; i<a; i++) cout << "-";
    cout << "+";
    cout << endl;
    }

    }
    int main() {

    Rectangle rect;
    rect.a = 5;
    rect.b = 3;

    rect.print ();
    cout <<endl<<endl;

    system("PAUSE");
    return 0;
    }

    "//otpe4atvane na..."

    //otpe4atvane na...
    cout << "|";
    for (int i=0;i<a; i++) cout << " ";
    cout <<"|";
    cout<< endl;
    {
    cout << "|";
    for (int j=0;j<b;j++)
    cout << "|" << endl;


    }

    cout << "|";
    cout << endl;

    !
    Last edited by BOdyROck; 28th February 2009 at 00:29.
    Epox 8U1697 GLI, Sempron 2800+ OC@2640Mhz, 512+1GB ddr400@165mhz 2.5-3-3-7 1T, Asus 8600GT, 160GB HITACHI, 320GB Samsung, 1TB WDC

  2. #2
    Registered User persy5's Avatar
    Join Date: Aug:2006
    Location: sofia
    Posts: 14
    #include <iostream>
    #include <cstdlib>

    using namespace std;

    class Rectangle

    {
    public:
    double a;
    double b;

    void print ();
    };

    void Rectangle:rint ()
    {
    //otpe4atvane na gorna linia
    {
    cout << "+";
    for (int i=0; i<a; i++) cout << "-";
    cout << "+";
    cout << endl;
    }
    //otpe4atvane na...

    for (int i=0; i<b; i++)
    {
    cout << "|";
    for (int i=0; i<a; i++) cout << " ";
    cout << "|";
    cout << endl;
    }
    //otpe4atvane na dolna linia
    {
    cout << "+";
    for (int i=0; i<a; i++) cout << "-";
    cout << "+";
    cout << endl;
    }

    }
    int main() {

    Rectangle rect;
    rect.a = 5;
    rect.b = 3;

    rect.print ();
    cout <<endl<<endl;

    system("PAUSE");
    return 0;
    }

  3. #3
    =D BOdyROck's Avatar
    Join Date: Sep:2008
    Location: In My Mind
    Posts: 133
    persy5 ! ;( !
    Epox 8U1697 GLI, Sempron 2800+ OC@2640Mhz, 512+1GB ddr400@165mhz 2.5-3-3-7 1T, Asus 8600GT, 160GB HITACHI, 320GB Samsung, 1TB WDC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |