-
#include "string.h"
#include "ctype.h"
#include "stdio.h"
search(char pd[])
{FILE *fp;
int time=0,i=0,j=0,Add[80],k=0,m;
char *ch,
str[900];
m=strlen(pd);
if((fp=fopen("haha.txt","r"))==NULL)
{
printf("Cannot open this file\n");
exit(0);
}
for(;!feof(fp);i++)
{
str[i]=fgetc(fp);
if(tolower(str[i])==tolower(pd[k]))
{k++;
if(k==m)
if(!isalpha(i-m)&&!isalpha((str[i++]=fgetc(fp))))
{
time++;
Add[j]=i-m+1;
j++;
k=0;
}
else k=0;
}
}
if(time)
{
printf("The time is:%d\n",time);
printf("The Adders is:\n");
for(i=0;i
標簽:
查詢學會少年宮
上傳時間:
2016-12-29
上傳用戶:767483511
-
#include "string.h"
#include "ctype.h"
#include "stdio.h"
search(char pd[])
{FILE *fp;
int time=0,i=0,j=0,Add[80],k=0,m;
char *ch,
str[900];
m=strlen(pd);
if((fp=fopen("haha.txt","r"))==NULL)
{
printf("Cannot open this file\n");
exit(0);
}
for(;!feof(fp);i++)
{
str[i]=fgetc(fp);
if(tolower(str[i])==tolower(pd[k]))
{k++;
if(k==m)
if(!isalpha(i-m)&&!isalpha((str[i++]=fgetc(fp))))
{
time++;
Add[j]=i-m+1;
j++;
k=0;
}
else k=0;
}
}
if(time)
{
printf("The time is:%d\n",time);
printf("The Adders is:\n");
for(i=0;i<j;i++)
printf("%5d",Add[i]);
if(i%5==0)
printf("\n");
getch();
fclose(fp);
}
else
printf("Sorry!Cannot find the word(^_^)");
}
main()
{
char pd[10],choose='y';
int flag=1;
while(flag)
{printf("In put the word you want to seqarch:");
scanf("%s",pd);
search(strlwr(pd));
printf("\nWould you want to continue?(Y/N):");
getchar();
scanf("%c",&choose);
if((tolower(choose))=='n')
flag=0;
else flag=1;
}
printf("Thanks for your using!Bye-bye!\n");
getch();
}
標簽:
學生專用
上傳時間:
2016-12-29
上傳用戶:767483511
-
// 學生管理.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "resource.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
// Foward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
struct person
{
char name[10];
int ID;
int cj_yw;
int cj_sx;
struct person* next;
struct person* pro;
}per;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_MY, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_MY);
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage is only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was Added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_MY);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCSTR)IDC_MY;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
return RegisterClassEx(&wcex);
}
//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
RECT rt;
GetClientRect(hWnd, &rt);
DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
標簽:
計算器
學生
上傳時間:
2016-12-29
上傳用戶:767483511
-
// 學生管理.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "resource.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
// Foward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
struct person
{
char name[10];
int ID;
int cj_yw;
int cj_sx;
struct person* next;
struct person* pro;
}per;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_MY, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_MY);
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage is only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was Added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_MY);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCSTR)IDC_MY;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
return RegisterClassEx(&wcex);
}
//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
RECT rt;
GetClientRect(hWnd, &rt);
DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
標簽:
學生 計算器
上傳時間:
2016-12-29
上傳用戶:767483511
-
Visual Basic(簡稱VB)是Microsoft公司開發的一種通用的基于對象的程序設計語言,為結構化的、模塊化的、面向對象的、包含協助開發環境的事件驅動為機制的可視化程序設計語言。是一種可用于微軟自家產品開發的語言。 [1]
“Visual” 指的是開發圖形用戶界面 (GUI) 的方法——不需編寫大量代碼去描述界面元素的外觀和位置,而只要把預先建立的對象Add到屏幕上的一點即可。 “Basic”指的是 BASIC (Beginners All-Purpose Symbolic Instruction Code) 語言,是一種在計算技術發展歷史上應用得最為廣泛的語言。
標簽:
VB精選
上傳時間:
2019-03-06
上傳用戶:Yingshangling
-
在包 hugeinteger 中創建功能類 HugeInteger,該類用來存放和操作一個不超過
40 位的大整數。
(1) 定義一個構造函數,用來對大整數進行初始化。參數為一個字符串。
(2) 定義 input 成員函數,實現大整數的重新賦值。參數為一個字符串,無返回
值。
(3) 定義 output 成員函數,將大整數輸出到屏幕上。無參數無返回值。
(4) 定義 Add 成員函數,實現兩個大整數的加法。參數為一個 HugeInteger 對
象,無返回值,例如:
HugeInteger A = new HugeInteger("12345");
HugeInteger B = new HugeInteger("1234");
A.Add(B);
此時,A 為 13579,B 為 1234。
(5) 定義 sub 成員函數,實現兩個大整數的減法。參數和返回值同 Add 函數。
(6) 定義若干大整數關系運算的成員函數,包括 isEqualTo(等于,=)、
isNotEqualTo(不等于,≠)、isGreaterThan(大于,>)、isLessThan(小
于,<)、isGreaterThanOrEqualTo(大于等于,≥)和 isLessThanOrEqualTo
(小于等于,≤)。這些函數的參數為一個 HugeInteger 對象,返回值為一個
布爾類型,表示關系運算的結果,例如:
HugeInteger A = new HugeInteger("12345");
HugeInteger B = new HugeInteger("1234");
那么此時 A.isGreaterThan(B)的結果應當為 True,表示 12345>1234。
標簽:
java
整數
運算
上傳時間:
2019-06-01
上傳用戶:idealist
-
keil C51 v6.12 完全解密版的安裝說明
安裝方法是先將V6.12安裝程序復制到某個目錄下,如復制到D:\keilC51
然后執行D:\keilC51\setup\setup.exe 安裝程序,選擇安裝Eval Version版進
行安裝。
注冊碼:K199U-20071-12A9U
當出現Please insert the Add-on disk的提示畫面,可按next按鈕(不用
插入軟盤)。
安裝好之后就可以使用,沒有代碼大小的限制,這是完全版,比 Eval版增
加浮點庫等內容。
標簽:
keilc
51
12
v6
上傳時間:
2020-03-20
上傳用戶:mimeme
-
At present, there is a strong worldwide push toward bringing fiber closer to indi-
vidual homes and businesses. Fiber-to-the-Home/Business (FTTH/B) or close to it
networks are poised to become the next major success story for optical fiber com-
munications. In fact, FTTH connections are currently experiencing double-digit or
even higher growth rates, e.g., in the United States the annual growth rate was 112%
between September 2006 and September 2007, and their presence can Add value of
U.S. $4,000–15,000 to the selling price of a home.
標簽:
Technologies
Broadband
Networks
Access
上傳時間:
2020-05-26
上傳用戶:shancjb
-
This book is intended for RF planners, to serve as a practical tool in their daily work
designing indoor radio distribution systems.
Based on feedback from readers of the first edition it was clear to me that I needed to Add
more material and in depth description of the basics of indoor systems based on using
repeaters; this has grown into a new Section 4.7.
There was also a strong demand to Add more detail and dedicate a full chapter to radio
planning in tunnels, for both rail and road tunnels; and redundancy principles in the design
focus for solving the challenge of handover zones. An entire Chapter 11 is now dedicated to
tunnel radio planning.
標簽:
Planning
Indoor
Radio
上傳時間:
2020-05-27
上傳用戶:shancjb
-
Developers, manufacturers and marketers of products incorporating short-
range radio systems are experts in their fields—security, telemetry,
medical care, to name a few. Often they Add a wireless interface just to
eliminate wires on an existing wired product. They may adapt a wireless
subsystem, which is easy to integrate electrically into their system, only to
find that the range is far short of what they expected, there are frequent
false alarms, or it doesn’t work at all. It is for these adapters of wireless
subsystems that this book is primarily intended.
標簽:
Communication
Short-range
Wireless
上傳時間:
2020-06-01
上傳用戶:shancjb