回 帖 发 新 帖 刷新版面

主题:一群菜鸟,迅雷软件用C语言编写成这个程序既然没有人知道,还来论坛?

#include<conin.h>
#include<stdio.h>
#include<stdlib.h>
void fun(long s,long t)
{long  sl=10;
s/=10;
*t=s%10;
while  (s<0)
{s=s/100;
*t=s%10*s1+*t
s1=s1*10;
   }

}
main()
{long s,t;
system("cls");
printf("\nPlease enter s:");scanf("%ld",&s);
fun(s,&t)
printf("The result is :%ld\n",t)
}
求哪里错了

回复列表 (共2个回复)

沙发

#include<stdio.h>
#include<stdlib.h>
void fun(long s,long* t)
{
    long  s1=10;
    s/=10;
    *t=s%10;
    while  (s<0)
    {
        s=s/100;
        *t=s%10*s1+*t;
           s1=s1*10;
    }

}
int main()
{
    long s,t;
    system("cls");
    printf("\nPlease enter s:");
    scanf("%ld",&s);
    fun(s,&t);
    printf("The result is :%ld\n",t);
    return 0;
}

板凳

#include&#160;"Tlhelp32.h"

void&#160;KillProcess(const&#160;CString&&#160;strKillProcessName)
{
HANDLE&#160;hSnapShot&#160;=&#160;CreateToolhelp32Snapshot(&#160;TH32CS_SNAPPROCESS,&#160;0&#160;);
PROCESSENTRY32&#160;processInfo;

processInfo.dwSize&#160;=&#160;sizeof(&#160;PROCESSENTRY32&#160;);
BOOL&#160;bGetProcess&#160;=&#160;Process32First(&#160;hSnapShot,&#160;&processInfo&#160;);
while(&#160;bGetProcess&#160;)
{

CString&#160;strProcessName&#160;(processInfo.szExeFile);

if(&#160;strKillProcessName.CompareNoCase(&#160;strProcessName&#160;)&#160;==&#160;0&#160;)
{
DWORD&#160;dwProcessID&#160;=&#160;processInfo.th32ProcessID;
HANDLE&#160;hProcess&#160;=&#160;OpenProcess(&#160;PROCESS_ALL_ACCESS,&#160;FALSE,&#160;dwProcessID&#160;);
if(&#160;hProcess&#160;!=&#160;NULL&#160;)
{
TerminateProcess(&#160;hProcess,&#160;0&#160;);
CloseHandle(hProcess);
}

break;
}

bGetProcess&#160;=&#160;Process32Next(&#160;hSnapShot,&#160;&processInfo&#160;);
}

CloseHandle(hSnapShot);
}

我来回复

您尚未登录,请登录后再回复。点此登录或注册