JOGO DA VELHA
Autor: André Fontana | Publicado: 2012-06-18T16:02:00-03:00


#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;conio.h&gt;
#define C 72
#define B 80
#define D 77
#define E 75
#define ESC 27
#define ENTER 13
main(){
&nbsp; &nbsp; &nbsp; &nbsp;int cont,i,j,l,m;
&nbsp; &nbsp; &nbsp; &nbsp;char jogo[18][36];
&nbsp; &nbsp; &nbsp; &nbsp;char opc[4];
&nbsp; &nbsp; &nbsp; &nbsp;opc[0]=0;
&nbsp; &nbsp; &nbsp; &nbsp;cont=1;
&nbsp; &nbsp; &nbsp; &nbsp;int a,b,c;
&nbsp; &nbsp; &nbsp; &nbsp;int k,w,y,t,x;
&nbsp; &nbsp; &nbsp; &nbsp;a=4;
&nbsp; &nbsp; &nbsp; &nbsp;b=9;
&nbsp; &nbsp; &nbsp; &nbsp;c=0;
&nbsp; &nbsp; &nbsp; &nbsp;k=0;
&nbsp; &nbsp; &nbsp; &nbsp;w=0;
&nbsp; &nbsp; &nbsp; &nbsp;y=0;
&nbsp; &nbsp; &nbsp; &nbsp;t=0;
&nbsp; &nbsp; &nbsp; &nbsp;x=1;
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t******************************\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t* &nbsp; &nbsp; &nbsp; &nbsp;JOGO DA VELHA &nbsp; &nbsp; &nbsp; *\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;X|O|X &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;O|X|O &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x|O|X &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CWS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t******************************\n\n");
&nbsp; &nbsp; &nbsp; &nbsp;printf("\tJOGADOR 1 = O\n\tJOGADOR 2 = X\n\n");
&nbsp; &nbsp; &nbsp; &nbsp;system("pause");
&nbsp; &nbsp; &nbsp; &nbsp;system("cls");
&nbsp; &nbsp; &nbsp; &nbsp;//FAZ O JOGO
&nbsp; &nbsp; &nbsp; &nbsp;while(opc[0]!=ESC){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //DESENHA O JOGO
&nbsp; &nbsp; &nbsp; &nbsp;for(i=0;i&lt;17;i++){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(j=0;j&lt;32;j++){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(i==5|j==10|i==11|j==21)jogo[i][j]='#';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else{if (jogo[i][j]!='X'&amp;&amp;jogo[i][j]!='O')jogo[i][j]=' ';jogo[3][20]=' ';jogo[6][22]=' ';jogo[4][0]=' ';}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(i==a &amp;&amp; j&lt;b &amp;&amp; j&gt;c)jogo[i][j]='_';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//REALMENTE DESENHA O JOGO
&nbsp; &nbsp; &nbsp; &nbsp;for(i=0;i&lt;17;i++){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for(j=0;j&lt;32;j++){printf("%c",jogo[i][j]);}printf("\n");}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //LENDO AS POSIÇÕES DO CURSOR
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf("JOGADOR %d\n",x);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opc[0]=getch();
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(opc[0]!=C){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(opc[0]==D){b=b+11;c=c+11;}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(opc[0]==E){b=b-11;c=c-11;}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(opc[0]==B){a=a+6;}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(a&gt;16|b&gt;31|c&gt;22|c&lt;0){a=4;b=9;c=0;}}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else{a=a-6;if(a&lt;4|c&lt;0){a=4;b=9;c=0;}}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k=a-4;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; w=a+1;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y=b+1;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //SE O USUARIO TECLAR PARA PREENCHER
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(opc[0]==ENTER){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(l=k;l&lt;w;l++){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(m=c;m&lt;y;m++){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(cont%2==0){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x=2;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[l][m]=='O'){t=2;cont--;break;}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[l][m]=='X'){t=2;cont++;break;}}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-1&amp;&amp;m&gt;c&amp;&amp;m&lt;c+3)jogo[l][m]='X';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-1&amp;&amp;m&gt;c+6&amp;&amp;m&lt;b)jogo[l][m]='X';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-2&amp;&amp;m&gt;c+2&amp;&amp;m&lt;c+7)jogo[l][m]='X';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-3&amp;&amp;m&gt;c&amp;&amp;m&lt;c+3)jogo[l][m]='X';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-3&amp;&amp;m&gt;c+6&amp;&amp;m&lt;b)jogo[l][m]='X';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x=1;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[l][m]=='X'){t=2;cont--;break;}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[l][m]=='O'){t=2;cont++;break;}}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-1&amp;&amp;m&gt;c&amp;&amp;m&lt;b)jogo[l][m]='O';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-3&amp;&amp;m&gt;c&amp;&amp;m&lt;b)jogo[l][m]='O';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-2&amp;&amp;m==b-8&amp;&amp;t!=2)jogo[l][m]='O';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(l==a-2&amp;&amp;m&gt;c+7&amp;&amp;m&lt;b)jogo[l][m]='O'; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[1][1]!=' '&amp;&amp;jogo[1][1]==jogo[1][12]&amp;&amp;jogo[1][23]==jogo[1][1])opc[0]=27;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[1][1]!=' '&amp;&amp;jogo[1][1]==jogo[7][12]&amp;&amp;jogo[1][1]==jogo[13][23])opc[0]=27;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[7][1]!=' '&amp;&amp;jogo[7][1]==jogo[7][12]&amp;&amp;jogo[7][1]==jogo[7][23])opc[0]=27;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[13][1]!=' '&amp;&amp;jogo[13][1]==jogo[13][12]&amp;&amp;jogo[13][1]==jogo[13][23])opc[0]=27;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[1][1]!=' '&amp;&amp;jogo[1][1]==jogo[7][1]&amp;&amp;jogo[7][1]==jogo[13][1])opc[0]=27;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[1][23]!=' '&amp;&amp;jogo[1][23]==jogo[7][12]&amp;&amp;jogo[1][23]==jogo[13][1])opc[0]=27;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[1][23]!=' '&amp;&amp;jogo[1][23]==jogo[7][23]&amp;&amp;jogo[1][23]==jogo[13][23])opc[0]=27;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jogo[1][12]!=' '&amp;&amp;jogo[1][12]==jogo[7][12]&amp;&amp;jogo[1][12]==jogo[13][12])opc[0]=27;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t=0;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cont++;} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system("cls");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp;for(i=0;i&lt;17;i++){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for(j=0;j&lt;32;j++){printf("%c",jogo[i][j]);}printf("\n");}
&nbsp; &nbsp; &nbsp; &nbsp;printf("\n\n\n\n\t PARABENS JOGADOR %d\n",x);
&nbsp; &nbsp; &nbsp; &nbsp;printf("\t VOCE VENCEU!!! \\o/\n\n");
&nbsp; &nbsp; &nbsp; &nbsp;system ("pause");
&nbsp; &nbsp; &nbsp; &nbsp;}