Having simple issues I don't know how to solve. Help!

I've been trying to recreate a simple game of hangman. I came as far as I could without help, but recently I've run into a problem I don't know how to solve. This code can replace ( // a - u || e - y || w -c || v - b || x - d || z - f ))
or even duplicate these letters and I don't know why it does that. It'd be also really helpful if anyone could tell me if it was also possible to shorten this code, simplify it. To those who take a look and help me out. Thank you very much!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <cstring>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
{
    char zodis[20];
    char zodis2[25];
    char h, ch;
    int l, i, ng, n, k, x;
do{
        cout << "\n\t\t ***** () Hangman () ***** \n\n\n\n";
        cout << "\t\t Enter a word : ";
        cin.get(zodis, 20);
        l=strlen(zodis); 
        char pasir[20]="0";
        n=0;k=0;
        system("CLS");

        for(i=0;i<=20;i++)
            {
        if (zodis[i]=='\0') {zodis2[i]='\0';break;}
        if (zodis[i]!=' ')  zodis2[i]='-'; 
        }
        ng=l+3;
    do{
        cia:
        if (k!=0)
        cout << "\n\n\t\t\t Chosen letters : " << pasir << "\n";
        cout << "\n\n\n\t\t\t      " << zodis2 << "\n\n\n Guesses left :  "<< ng << ", choose the next letter : ";
        cin >> ch; 
        system("CLS");
        for ( i=0;i<25;i++ )
        if ( pasir[i] == ch ) 
            {
     cout << "\t\t  Raide : " << ch << " : jau pasirinkote\n";
     goto cia;
     }
     ng--; pasir[k]=ch; pasir[k+1]=',';k+=2;

     for (i=0;i<=20;i++)
     if (zodis[i]==ch || zodis[i]==ch+20 || zodis[i]==ch-20) zodis2[i]=ch;
     if (!strcmp(zodis2,zodis))
        {
            system("CLS");
            cout << "\n\t\t\t      " << string(zodis) << "\n\n\t\t\t  Correct! :) \n" ; break;
            }
     }
    while(ng > 0 || !strcmp (zodis2,zodis));
    if (strcmp(zodis2,zodis))
        cout << "\n The word was : " << string(zodis) << endl;
        }
    while (ch==0);
    return 0;
}
Some improvements you could make:
Get rid of all this old c style strings and use std::string.
Get rid of goto.
Break your main function into different functions.
Use meaningful variable names, prefer English so everyone can understand.
Topic archived. No new replies allowed.