#include<stdio.h>
void head(int lmargin, int base, int height)
{
int i, j, k; // Loop Counter
for(i=0; i<height; i++)
{
for(j=0; j<lmargin; j++)
printf(" ");
for(k=0; k<base; k++)
printf("*");
printf("\n");
}
}
void neck(int lmargin, int base, int height)
{
int i, j, k; // Loop Counter
for(i=0; i<height; i++)
{
for(j=0; j<lmargin+i; j++)
printf(" ");
for(k=0; k<base-(i*2); k++)
printf("*");
printf("\n");
}
}
void arm(int lmargin, int base, int height, int jump)
{
int i, j, k, count=0; // Loop Counter
for(i=0; i<height; i++)
{
for(j=0; j<lmargin; j++)
printf(" ");
for(k=0; k<base; k++) {
printf("*");
count++;
if(count == jump) {
printf(" ");
count = 0;
}
}
printf("\n");
count = 0;
}
}
void body(int lmargin, int base, int height)
{
int i, j, k; // Loop Counter
for(i=0; i<height; i++)
{
for(j=0; j<lmargin; j++)
printf(" ");
for(k=0; k<base; k++)
printf("*");
printf("\n");
}
}
void leg(int lmargin, int base, int height, int jump)
{
int i, j, k, count=0;
for(i=0; i<height; i++)
{
for(j=0; j<lmargin; j++)
printf(" ");
for(k=0; k<base; k++){
printf("*");
count++;
if(count == jump) {
printf(" ");
count = 0;
}
}
printf("\n");
count = 0;
}
}
void up_tri(int Imargin , int base)
{
int i,j,k;
for(i=0; i<base; i++)
{
for(j=0;j<Imargin-i; j++)
printf(" ");
for(k+0;k<base+(i*2); k++)
printf("*");
printf("\n");
}
}
void main(void)
{
head(4, 9, 2);
neck(6, 5, 3);
arm(0, 15, 2, 5);
body(5, 7, 6);
leg(5, 6, 6, 3);
up_tri(3, 3);
}
도형함수로 로봇만들기를하고잇거든요 근데 Run-Time Check Failure #3 - The variable 'k' is being used without being initialized.이런오류가떠요..