#include "resource.h"
#include <Windows.h>
long _stdcall dlg(HWND,UINT,UINT,long);
long _stdcall myfunc(HWND,UINT,UINT,long);
WNDCLASSA a;
HINSTANCE h;
int _stdcall WinMain(HINSTANCE i,HINSTANCE j,char *k,int l)
{
HWND h;
MSG m;
a.lpszClassName="my";
a.hInstance=i;
a.lpfnWndProc=myfunc;
a.hbrBackground=(HBRUSH)CreateSolidBrush(RGB(234,67,90));
RegisterClassA(&a);
h=CreateWindowA("my","Fibonocci",WS_OVERLAPPEDWINDOW,10,10,200,300,0,0,i,0);
ShowWindow(h,3);
while(GetMessage(&m,0,0,0))
DispatchMessage(&m);
return 0;
}
long _stdcall myfunc(HWND w,UINT x,UINT y,long z)
{
switch(x)
{
case WM_LBUTTONDOWN:
DialogBoxW(h,MAKEINTRESOURCE(dIALOG1),w,(DLGPROC)dlg);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProcA(w,x,y,z);
}
return 0L;
}
long _stdcall dlg(HWND w1,UINT x1,UINT y1,long z1)
{
int i,t,n1,s=0,d;
long int a,b,c;
char st[20];
switch(x1)
{
case WM_COMMAND:
{
switch(y1)
{
case PERFECT:
n1=GetDlgItemInt(w1,EDIT1,NULL,true);
for(i=1;i<=n1;i++)
{
t=i;
s=0;
for(int j=1;j<i;j++)
{
if(i%j==0)
{
s=s+j;
}
}
if(t==s)
{
wsprintfA(st,"%d",s);
SendDlgItemMessageA(w1,LIST1,LB_ADDSTRING,0,(DWORD)(LPSTR)st);
}
}
break;
case ARMSTRONG:
n1=GetDlgItemInt(w1,EDIT1,NULL,true);
for(i=1;i<=n1;i++)
{
t=i;
s=0;
while(t>0)
{
d=t%10;
s=s+d*d*d;
t=t/10;
}
if(s==i)
{
wsprintfA(st,"%d",i);
SendDlgItemMessageA(w1,LIST2,LB_ADDSTRING,0,(DWORD)(LPSTR)st);
}
}
break;
case PRIME:
n1=GetDlgItemInt(w1,EDIT1,NULL,true);
for(i=2;i<=n1;i++)
{
t=0;
for( int j=2;j<=i/2;j++)
{
if(i%j==0)
{
t=1;
}
}
if(t==0)
{
wsprintfA(st,"%d",i);
SendDlgItemMessageA(w1,LIST3,LB_ADDSTRING,0,(DWORD)(LPSTR)st);
}
}
break;
case FIBONOCCI:
n1=GetDlgItemInt(w1,EDIT1,NULL,true);
a=-1;
b=1;
for(i=1;i<=n1;i++)
{
c=a+b;
wsprintfA(st,"%ld",c);
SendDlgItemMessageA(w1,LIST4,LB_ADDSTRING,0,(DWORD)(LPSTR)st);
a=b;
b=c;
}
break;
case EXIT:
EndDialog(w1,false);
break;
}
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProcA(w1,x1,y1,z1);
}
return 0L;
}
#include <Windows.h>
long _stdcall dlg(HWND,UINT,UINT,long);
long _stdcall myfunc(HWND,UINT,UINT,long);
WNDCLASSA a;
HINSTANCE h;
int _stdcall WinMain(HINSTANCE i,HINSTANCE j,char *k,int l)
{
HWND h;
MSG m;
a.lpszClassName="my";
a.hInstance=i;
a.lpfnWndProc=myfunc;
a.hbrBackground=(HBRUSH)CreateSolidBrush(RGB(234,67,90));
RegisterClassA(&a);
h=CreateWindowA("my","Fibonocci",WS_OVERLAPPEDWINDOW,10,10,200,300,0,0,i,0);
ShowWindow(h,3);
while(GetMessage(&m,0,0,0))
DispatchMessage(&m);
return 0;
}
long _stdcall myfunc(HWND w,UINT x,UINT y,long z)
{
switch(x)
{
case WM_LBUTTONDOWN:
DialogBoxW(h,MAKEINTRESOURCE(dIALOG1),w,(DLGPROC)dlg);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProcA(w,x,y,z);
}
return 0L;
}
long _stdcall dlg(HWND w1,UINT x1,UINT y1,long z1)
{
int i,t,n1,s=0,d;
long int a,b,c;
char st[20];
switch(x1)
{
case WM_COMMAND:
{
switch(y1)
{
case PERFECT:
n1=GetDlgItemInt(w1,EDIT1,NULL,true);
for(i=1;i<=n1;i++)
{
t=i;
s=0;
for(int j=1;j<i;j++)
{
if(i%j==0)
{
s=s+j;
}
}
if(t==s)
{
wsprintfA(st,"%d",s);
SendDlgItemMessageA(w1,LIST1,LB_ADDSTRING,0,(DWORD)(LPSTR)st);
}
}
break;
case ARMSTRONG:
n1=GetDlgItemInt(w1,EDIT1,NULL,true);
for(i=1;i<=n1;i++)
{
t=i;
s=0;
while(t>0)
{
d=t%10;
s=s+d*d*d;
t=t/10;
}
if(s==i)
{
wsprintfA(st,"%d",i);
SendDlgItemMessageA(w1,LIST2,LB_ADDSTRING,0,(DWORD)(LPSTR)st);
}
}
break;
case PRIME:
n1=GetDlgItemInt(w1,EDIT1,NULL,true);
for(i=2;i<=n1;i++)
{
t=0;
for( int j=2;j<=i/2;j++)
{
if(i%j==0)
{
t=1;
}
}
if(t==0)
{
wsprintfA(st,"%d",i);
SendDlgItemMessageA(w1,LIST3,LB_ADDSTRING,0,(DWORD)(LPSTR)st);
}
}
break;
case FIBONOCCI:
n1=GetDlgItemInt(w1,EDIT1,NULL,true);
a=-1;
b=1;
for(i=1;i<=n1;i++)
{
c=a+b;
wsprintfA(st,"%ld",c);
SendDlgItemMessageA(w1,LIST4,LB_ADDSTRING,0,(DWORD)(LPSTR)st);
a=b;
b=c;
}
break;
case EXIT:
EndDialog(w1,false);
break;
}
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProcA(w1,x1,y1,z1);
}
return 0L;
}
Your Affiliate Money Printing Machine is ready -
ReplyDeleteAnd earning money online using it is as easy as 1...2...3!
Follow the steps below to make money...
STEP 1. Input into the system which affiliate products the system will push
STEP 2. Add PUSH BUTTON traffic (it LITERALLY takes 2 minutes)
STEP 3. Watch the affiliate products system grow your list and sell your affiliate products all for you!
Do you want to start making money??
Click here to make money with the system
If you're attempting to lose kilograms then you certainly have to start following this totally brand new custom keto diet.
ReplyDeleteTo produce this service, licensed nutritionists, fitness trainers, and professional cooks have joined together to produce keto meal plans that are productive, convenient, economically-efficient, and delicious.
Since their first launch in 2019, hundreds of individuals have already transformed their figure and well-being with the benefits a professional keto diet can offer.
Speaking of benefits; in this link, you'll discover eight scientifically-tested ones provided by the keto diet.