完整代码
#include <stdio.h>
#include <windows.h>
int g_iShared = 0;
void printfit()
{
char sz[2];
sprintf(sz,"%d",g_iShared);
puts(sz);
}
int __cdecl main()
{
while(true){
printfit();
int iNew = g_iShared +1;
if (iNew == 10)
{
//
iNew = 0;
}
g_iShared = iNew;
Sleep(1000);
}
return 0;
}