Bun? ziua ,am f?cut un program în care s? joci x ?i 0 în c++ ... dar am o problem? , la sfâr?it ca s? joc înc? o dat? îmi d? remiz? dup? ce pun numele juc?torilor . ?sta e codul , ce trebuie s? adaug ca s? joc din nou f?r? s? închid programul ? #include "iostream.h" #include "conio.h" #include "stdlib.h" int main() { int i,j,k=0; char a[3][3],nume1[30],nume2[30],q,v,castig='r'; begin: system("color A"); cout<<"jucator1:";cin>>nume1; system("cls"); cout<<"jucator2:";cin>>nume2; system("cls"); a[0][0]='1'; a[0][1]='2'; a[0][2]='3'; a[1][0]='4'; a[1][1]='5'; a[1][2]='6'; a[2][0]='7'; a[2][1]='8'; a[2][2]='9'; while((k<=9)&&(castig=='r')) { cout<<"Introduceti un numar:"<<endl; cout<<a[0][0]<<" "<<a[0][1]<<" "<<a[0][2]<<endl; cout<<a[1][0]<<" "<<a[1][1]<<" "<<a[1][2]<<endl; cout<<a[2][0]<<" "<<a[2][1]<<" "<<a[2][2]<<endl; cout<<nume1<<":"; cin>>q; for(i=0;i<=2;i++) for(j=0;j<=2;j++) if(q==a[i][j]) a[i][j]='X'; k++; if((a[0][0]==a[0][1])&&(a[0][1]==a[0][2])) castig=a[0][0]; if((a[0][0]==a[2][0])&&(a[2][0]==a[1][0])) castig=a[0][0]; if((a[1][0]==a[1][1])&&(a[1][1]==a[1][2])) castig=a[1][0]; if((a[2][0]==a[2][1])&&(a[2][1]==a[2][2])) castig=a[2][0]; if((a[0][1]==a[1][1])&&(a[1][1]==a[2][1])) castig=a[0][1]; if((a[0][2]==a[1][2])&&(a[1][2]==a[2][2])) castig=a[0][2]; if((a[0][0]==a[1][1])&&(a[1][1]==a[2][2])) castig=a[0][0]; if((a[0][2]==a[1][1])&&(a[1][1]==a[2][0])) castig=a[0][0]; system("cls"); if(castig=='r') { cout<<"Introduceti un numar:"<<endl; cout<<a[0][0]<<" "<<a[0][1]<<" "<<a[0][2]<<endl; cout<<a[1][0]<<" "<<a[1][1]<<" "<<a[1][2]<<endl; cout<<a[2][0]<<" "<<a[2][1]<<" "<<a[2][2]<<endl; cout<<nume2<<":"; cin>>q; for(i=0;i<=2;i++) for(j=0;j<=2;j++) if(q==a[i][j]) a[i][j]='0'; k++; system("cls"); if((a[0][0]==a[0][1])&&(a[0][1]==a[0][2])) castig=a[0][0]; if((a[0][0]==a[2][0])&&(a[2][0]==a[1][0])) castig=a[0][0]; if((a[1][0]==a[1][1])&&(a[1][1]==a[1][2])) castig=a[1][0]; if((a[2][0]==a[2][1])&&(a[2][1]==a[2][2])) castig=a[2][0]; if((a[0][1]==a[1][1])&&(a[1][1]==a[2][1])) castig=a[0][1]; if((a[0][2]==a[1][2])&&(a[1][2]==a[2][2])) castig=a[0][2]; if((a[0][0]==a[1][1])&&(a[1][1]==a[2][2])) castig=a[0][0]; if((a[0][2]==a[1][1])&&(a[1][1]==a[2][0])) castig=a[0][0]; } } system("color C"); if(castig=='X') cout<<nume1<<" a castigat"<<endl; if(castig=='0') cout<<nume2<<" a castigat"<<endl; if(castig=='r') cout<<"REMIZA!"<<endl; cout<<"Apasati q pentru a iesi si c pentru a mai juca:"<<endl; cin>>v; if(v=='q') return 0; if(v=='c') { system("cls"); goto begin; } }