以下代码如果不用GOTO的话,应该怎么改,请高手帮忙看看
int m_Count = 0;
int index = 5;
A:
m_Count4 = index + 1;
goto C;
B:
if (m_Data[index] == m_Data[m_Count4])
{
m_Count++;
}
m_Count4++;
C:
m_Count5 = 9;
if (m_Count4 <= m_Count5)
{
goto B;
}
index++;
m_Count5 = 8;
if (index <= m_Count5)
{
goto A;
}
return m_Count;
int m_Count = 0;
int index = 5;
A:
m_Count4 = index + 1;
goto C;
B:
if (m_Data[index] == m_Data[m_Count4])
{
m_Count++;
}
m_Count4++;
C:
m_Count5 = 9;
if (m_Count4 <= m_Count5)
{
goto B;
}
index++;
m_Count5 = 8;
if (index <= m_Count5)
{
goto A;
}
return m_Count;
解决方案 »
- CoCreateInstance怎么注册失败
- WinMain函数是在哪里调用的
- char[]值赋给CString后只得到部分数据
- 求助:开发COM中,如何同一库中的一个COM中创建另一个COM对象?
- snake资料及其代码
- 怎样查看这个system32\shell32.dll中包含的图标?
- 怎样做到listctrl的在线编辑?以及当我点击它时我怎样在它的格子上出现下拉列表框?
- AnimateWindow(...)在WinNT4.0中如何使用,很有趣的问题,搞不好你会发现NT的Bug
- 两幅位图的合成效果,大家帮忙支招!
- 图象显示问题
- ADO访问MySQL的带参数的存储过程时出错,有代码,请帮忙看下问题在哪儿?
- 关于鼠标点击窗口关闭按钮的消息处理问题
int m_Count = 0;
int index = 5;
/////////////////////
m_Count4 = index + 1;
m_Count5 = 9;
while(m_Count4 <= m_Count5)
{
if (m_Data[index] == m_Data[m_Count4])
{
m_Count++;
}
m_Count4++;
}
index++;
m_Count5 = 8;
while(index<=m_Count5)
{
m_Count4 = index + 1;
m_Count5 = 9;
while(m_Count4 <= m_Count5)
{
if (m_Data[index] == m_Data[m_Count4])
{
m_Count++;
}
m_Count4++;
}
index++;
m_Count5 = 8;
}
return m_Count;