主题:一群菜鸟,迅雷软件用C语言编写成这个程序既然没有人知道,还来论坛?
progranfan
[专家分:0] 发布于 2012-06-12 20:10:00
#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个回复)
沙发
ZBC19921123 [专家分:320] 发布于 2012-06-12 22:33:00
#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;
}
板凳
progranfan [专家分:0] 发布于 2012-06-13 09:21:00
#include "Tlhelp32.h"
void KillProcess(const CString& strKillProcessName)
{
HANDLE hSnapShot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
PROCESSENTRY32 processInfo;
processInfo.dwSize = sizeof( PROCESSENTRY32 );
BOOL bGetProcess = Process32First( hSnapShot, &processInfo );
while( bGetProcess )
{
CString strProcessName (processInfo.szExeFile);
if( strKillProcessName.CompareNoCase( strProcessName ) == 0 )
{
DWORD dwProcessID = processInfo.th32ProcessID;
HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, dwProcessID );
if( hProcess != NULL )
{
TerminateProcess( hProcess, 0 );
CloseHandle(hProcess);
}
break;
}
bGetProcess = Process32Next( hSnapShot, &processInfo );
}
CloseHandle(hSnapShot);
}
我来回复