When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
8 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
i did this
#include <stdio.h>
int main(void) {
int baseInt;
int headInt;
printf(" 1\n");
printf(" 11\n");
printf("0000111\n");
printf("00001111\n");
printf("0000111\n");
printf(" 11\n");
printf(" 1\n");
return 0;
}
it says,
INPUT 1 4
Your output
1
11
0000111
00001111
0000111
11
1
Expected output
4
44
1111444
11114444
1111444
44
4i did this
#include <stdio.h>
int main(void) {
int baseInt;
int headInt;
printf(" 1\n");
printf(" 11\n");
printf("0000111\n");
printf("00001111\n");
printf("0000111\n");
printf(" 11\n");
printf(" 1\n");
return 0;
}
it says,
INPUT 1 4
Your output
1
11
0000111
00001111
0000111
11
1
Expected output
4
44
1111444
11114444
1111444
44
4
it seems you got the pattern right. I think you just have to make use of the input provided. Right now you are printing 0s and 1s without caring for the input given.
The only input i can see is if the input is 0 and 1
printf(" %d\n", headInt);
printf(" %d%d\n", headInt, headInt);
printf("%d%d%d%d%d%d%d\n", baseInt, baseInt, baseInt, baseInt, headInt, headInt, headInt);
printf("%d%d%d%d%d%d%d%d\n", baseInt, baseInt, baseInt, baseInt, headInt, headInt, headInt, headInt);
printf("%d%d%d%d%d%d%d\n", baseInt, baseInt, baseInt, baseInt, headInt, headInt, headInt);
printf(" %d%d\n", headInt, headInt);
printf(" %d\n", headInt);
I found this onlne
this worked right?
yes