English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

Hi,

The heart consists of two parts...
1) Top Part
2) Bottom Part

The Top Part has two Semi-Circles next to each other
The bottom part has an upside down triangle. (Equilateral Triangle)

Now, to draw the triangle is relatively simple.
void printEmpty(int n) {
int i;
for(i=0;i printf(" ");
}
int main()
{
int i,j;
int num;
for(i=0;i<20;i++) {
printEmpty(i);
for(j=0;j<(20-2*i);j++) {
printf("X");
}
printEmpty(i);
printf("\n");
}
return 0;
}

That will draw a triangle I think :x I didn't test it, but makes sence to me. You add an empty char at the begninng and at the end. While reducing it from the length of iteration in the inner loop.

Now your task is to try doing the circle. Which wont be hard. My hint will be, try to find the mathematical equation to calculate the arc.

Remember the reason why I added PrintEmpty(i) method, is every time I finish a line, I want to add a space from the beginning and at the end. Then Reduce the printing by 2 spaces the time.

Now for your circle, you need to remove it in an exponential approach. :) Thats the trick, it will be the EXACT same way I did it above, but the variable 20 will be half of that, so 10. So you can repeat 2 circles after each other.

Good Luck

2006-10-08 05:59:56 · answer #1 · answered by ? 6 · 1 0

WWF- won't be able to argue with fulfillment WCW- till the nWo Merger it develop into beating WWF WWE- again, won't be able to argue with fulfillment NJPW- the most globaly ordinary Puroresu fed. develop into homestead to fairly some large wrestlers from the U. S. and Japan. ECW- large wrestling, gritty storylines ROH- Arguably the perfect "organic" wrestling fed in the present day. TNA- needs fairly some improvements, yet no longer doing too badly. CZW- no longer prepared on the hardcore form....

2016-12-04 09:42:16 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers