33,027
社区成员




#include<stdio.h>
void main()
{
char row1[10] = {0,1,2,3,4,5,6,7,8,9};
char row2[10] = {0,0,0,0,0,0,0,0,0,0};
bool haveChanged = true;
while(haveChanged)
{
haveChanged = false;
for(char i = 0; i<10; i++)
{
int count = 0;
//caculate munber of "i" in row2.
for(char j = 0; j< 10; j++)
{
if(row2[j] == row1[i])
count++;
}
// mark and save change.
if(row2[i] != count)
{
haveChanged = true;
row2[i] = count;
}
}
}
printf("row2 is: \n")
for(char i = 0; i < 10; i++)
printf("%d, ",row2[i]);
printf("\n")
return;
}
void main()
{
char row1[10] = {0,1,2,3,4,5,6,7,8,9};
char row2[10] = {0,0,0,0,0,0,0,0,0,0};
bool haveChanged = true;
while(haveChanged)
{
haveChanged = false;
for(char i = 0; i<10; i++)
{
int count = 0;
//caculate munber of "i" in row2.
for(char j = 0; j< 10; j++)
{
if(i != j && row2[j] == row1[i])
count++;
}
// mark and save change.
if(row2[i] != count)
{
haveChanged = true;
row2[i] = count;
}
}
}
printf("row2 is: \n")
for(char i = 0; i < 10; i++)
print("%d, ",row2[i]);
return;
}
void main()
{
char row1[10] = {0,1,2,3,4,5,6,7,8,9};
char row2[10] = {0,0,0,0,0,0,0,0,0,0};
bool haveChanged = true;
while(haveChanged)
{
haveChanged = false;
for(char i = 0; i<10; i++)
{
int count = 0;
//caculate munber of "i" in row2.
for(char j = 0; j< 10; j++)
{
if(i != j && row2[j] == row[i])
count++;
}
// mark and save change.
if(row2[i] != count)
{
haveChanged = true;
row2[i] = count;
}
}
}
printf("row2 is: \n")
for(char i = 0; i < 10; i++)
print("%d, ",row2[i]);
return;
}