Puzzle #11
It is possible if the white makes move with knight.
For example..
White knight moves from g1 to h3,the black pawn move from e7 to e5, again the white knight moves from h3 to g1.
Puzzle #11
It is possible if the white makes move with knight.
For example..
White knight moves from g1 to h3,the black pawn move from e7 to e5, again the white knight moves from h3 to g1.
I don't think so. But who knows, they might.
:)1000000000
Yupee!!!!!!!!!!:icon_biggrin:
We won.
928...
Does anyone have any idea how to do the others (replacement with a different number of letters, insertion, deletion?
How about this one...
For insertion...
1)First read the line in the file and have it in the string.Insert the string "zzz" in the string that has the text read from the file.
2)Rewrite the line (the line in which you wanted to insert the text "zzz") with the string(the string which has the inserted text along with other texts).
For deletion...
1)get the line in a string and delete the text in the string. Replace the line with this string.
Both does all the modifications in the string and rewriting it in the file rather than making the changes in the file itself.
Correct me if i am wrong.
Hope this helps.
I think my post is similar to what sky diploma said.
Hello infiniteloop56,
Use separate nested for loops for top and bottom patterns. Have one nested for loop for the top pattern and have separate nested for loop for the bottom pattern.
The one below is for bottom pattern...
for(c = 0; c < numb; c++)
{
for(d = numb-1; d > c; d--)
{
cout << x;
}
}
In your code the for loop in line 36 will not function . numb4 will always be greater than numb3. Check the condition in that for loop and accordingly increment or decrement.
658...
[edit]
You make "BREAK" statement.
But how can we make "CONTINUE" statement using for loop?
>>Utsav Chokshi,
Here is a block using continue...
int i;
for(i=1 ; i<=20 ;i++ )
{
printf(" \n testing ");
if( i % 3==0 )
{ printf(" continue ");
continue;
}
printf("\n hello ");
}
The same block without using continue...
int i , j=1;
for(i=1 ; i<=20 ; i++)
{ printf("\n testing ");
if( i % 3==0 ) /* the statements above continue(that is from line 3 to 7 */
{ printf("\ncontinue");
j=0;
}
if( j!=0 )
{ printf(" \nhello "); /*This is where you give the statements following continue*/
j=1;
}
}
Variable j is used as a counter. So if value of i is divisible by three then j becomes 0 and hello will not be printed.