Results 1 to 17 of 17

Thread: ++?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Monkey Business poseydon's Avatar
    Join Date: Mar:2004
    Location: Sofia
    Posts: 1,537

    ++?

    ++. , . :

    , , 4 .

    :

    1025 2568 3689 1578 9563 5874

    .

    :

    char code[26] - ... char , , , integers.

    , , ... !
    Ad astra per aspera - To the stars through difficulties
    Nvidia - The way you are meant to be played!
    Blog - http://poseyd0n.blogspot.com/

  2. #2
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    , . , fgetc() stdio.h .
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  3. #3
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    , , ( , ). , ( ).

  4. #4
    Registered User Annihilator's Avatar
    Join Date: Jun:2004
    Location: Sofia
    Posts: 1,316
    4 8- char C

  5. #5
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    , . - . , 25 , 4 :

    char numbers[25][4];

    ?
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  6. #6
    MFrost's Avatar
    Join Date: Aug:2005
    Location: /
    Posts: 203
    Quote Originally Posted by Bombera View Post
    , . - . , 25 , 4 :

    char numbers[25][4];
    , , .. ...
    :
    Code:
    char numbers[25][4];
    ifstream fin("filename.txt");
    
    for(int i=0;i < 25 && !fin; i++) fin >> numbers[i];
    
    fin.close();
    : , ( ifstream ). ,

    Code:
    char dummy;
    ...
    for(...) fin >> numbers[i] >> dummy;
    Last edited by MFrost; 14th August 2007 at 00:59.

  7. #7
    no brain no pain baracuda's Avatar
    Join Date: Aug:2006
    Location: Sofia
    Posts: 35,840
    , ( ) ? , - ( , ).
    ( , ). ( - white space) . , .
    P.S. Bombera .
    P.S.2. , , 4-, . -. 357, 0357.
    Last edited by baracuda; 14th August 2007 at 00:41.

  8. #8
    no brain no pain baracuda's Avatar
    Join Date: Aug:2006
    Location: Sofia
    Posts: 35,840
    . - , -.

  9. #9
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    , , , -. -, . , . , ... , .
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  10. #10
    no brain no pain baracuda's Avatar
    Join Date: Aug:2006
    Location: Sofia
    Posts: 35,840
    Quote Originally Posted by Bombera View Post
    , , , -. -, . , . , ... , .
    - , , . . , .

  11. #11
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    Quote Originally Posted by baracuda View Post
    - , , . . , .


    , ...
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  12. #12
    Monkey Business poseydon's Avatar
    Join Date: Mar:2004
    Location: Sofia
    Posts: 1,537
    , . ...
    Ad astra per aspera - To the stars through difficulties
    Nvidia - The way you are meant to be played!
    Blog - http://poseyd0n.blogspot.com/

  13. #13
    Monkey Business poseydon's Avatar
    Join Date: Mar:2004
    Location: Sofia
    Posts: 1,537
    , . , . . , . 26 27 . - , . , .


    #include <iostream>
    #include <fstream>
    #include <string>
    using namespace std;
    int a;
    int code[28];
    string n;

    int funct(string n)
    {
    if (n == "A") return code[0]; else if (n == "a") return code[25];
    else if (n == "B") return code[1]; else if (n == "b") return code[24];
    else if (n == "C") return code[2]; else if (n == "c") return code[23];
    else if (n == "D") return code[3]; else if (n == "d") return code[22];
    else if (n == "E") return code[4]; else if (n == "e") return code[21];
    else if (n == "F") return code[5]; else if (n == "f") return code[20];
    else if (n == "G") return code[6]; else if (n == "g") return code[19];
    else if (n == "H") return code[7]; else if (n == "h") return code[18];
    else if (n == "I") return code[8]; else if (n == "i") return code[17];
    else if (n == "J") return code[9]; else if (n == "j") return code[16];
    else if (n == "K") return code[10]; else if (n == "k") return code[15];
    else if (n == "L") return code[11]; else if (n == "l") return code[14];
    else if (n == "M") return code[12]; else if (n == "m") return code[13];
    else if (n == "N") return code[13]; else if (n == "n") return code[12];
    else if (n == "O") return code[14]; else if (n == "o") return code[11];
    else if (n == "P") return code[15]; else if (n == "p") return code[10];
    else if (n == "Q") return code[16]; else if (n == "q") return code[9];
    else if (n == "R") return code[17]; else if (n == "r") return code[8];
    else if (n == "S") return code[18]; else if (n == "s") return code[7];
    else if (n == "T") return code[19]; else if (n == "t") return code[6];
    else if (n == "U") return code[20]; else if (n == "u") return code[5];
    else if (n == "V") return code[21]; else if (n == "v") return code[4];
    else if (n == "W") return code[22]; else if (n == "w") return code[3];
    else if (n == "X") return code[23]; else if (n == "x") return code[2];
    else if (n == "Y") return code[24]; else if (n == "y") return code[1];
    else if (n == "Z") return code[25]; else if (n == "z") return code[0];
    else if (n == " ") return code[26];

    //-----------------------------------Signs---------------------------------

    else if (n == ".") return code[18]; else if (n == "%") return code[7];
    else if (n == ",") return code[19]; else if (n == "$") return code[6];
    else if (n == "?") return code[20]; else if (n == "&") return code[5];
    else if (n == "!") return code[21]; else if (n == "*") return code[4];
    else if (n == ";") return code[22]; else if (n == "(") return code[3];
    else if (n == ":") return code[23]; else if (n == ")") return code[2];
    else if (n == "+") return code[24]; else if (n == "-") return code[1];
    else if (n == "@") return code[25]; else if (n == "=") return code[0];

    //-----------------------------------Numbers------------------------------

    else if (n == "1") return code[0]; else if (n == "6") return code[5];
    else if (n == "2") return code[1]; else if (n == "7") return code[6];
    else if (n == "3") return code[2]; else if (n == "8") return code[7];
    else if (n == "4") return code[3]; else if (n == "9") return code[8];
    else if (n == "5") return code[4]; else if (n == "0") return code[9];


    return ' ';
    }

    int main()
    {
    //----------------------------------Key_Reading---------------------------
    ifstream key;
    key.open("key.txt");

    for(int z=0; z<28; z++)
    {
    key >> a;
    code[z]= a;
    }
    key.close();


    /

    //----------------------------------Input Data-----------------------------
    ifstream input;
    input.open("input.txt");
    getline(input, n);
    input.close();


    //----------------------------------Output Data---------------------------------
    ofstream output;
    output.open("output.rtf");
    for(int i=0; i<n.size(); i++)
    output << funct(n.substr(i,1)) << " ";
    output.close();

    //system("PAUSE");
    return 0;
    }

    28 4 . Key Reading code[]. . , / / . .
    Ad astra per aspera - To the stars through difficulties
    Nvidia - The way you are meant to be played!
    Blog - http://poseyd0n.blogspot.com/

  14. #14
    MFrost's Avatar
    Join Date: Aug:2005
    Location: /
    Posts: 203
    ... if-, ...

    n char ( ) :

    Code:
      if(n <= 'Z' && n >= 'A' ) return code[n-'A'];
      if(n <= 'z' && n >= 'a' ) return code['z'-n];
    , -, , . , 'S', 'h' '.' ...

  15. #15
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    else if switch, , -. code , char, , 0( 31).
    . return code[n-31]. switch . . . n>='A'( !!!!) n<='Z' . , - return code[- , ], . '' code[0].
    funct e string? , , . . ? , .

    .. , MFrost ,
    ...
    Last edited by Bombera; 14th August 2007 at 19:50.
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  16. #16
    Monkey Business poseydon's Avatar
    Join Date: Mar:2004
    Location: Sofia
    Posts: 1,537
    , , . , . .
    Ad astra per aspera - To the stars through difficulties
    Nvidia - The way you are meant to be played!
    Blog - http://poseyd0n.blogspot.com/

  17. #17
    Registered User
    Join Date: Jul:2006
    Location:
    Posts: 480
    poseydon, .
    , 128 , ASCII . ASCII :

    Code:
    INDEX=ASCIITB[CHAR]
    CODE=CODETB[INDEX]
      :
    CODE=CODETB[ASCIITB[CHAR]]
    .
    , . , , . .

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 |