6. 打招呼( Can I introduce you to my colleague)

-I have heard a lot about you.

-Nothing bad I hope.

-No. Only good stuff I think. Are you having a good time?

-It's been good funso far. There are lots of nice people here.

-Yes, there are. So, can I get you a drink?

我听说了很多你的事。

希望不是说我坏话。

没有,我想都是好事,你玩的愉快吗?

目前为止玩得很愉快,这里有很多很好的人。

是啊,是有很多很好的人,那么我可以给你拿杯饮料吗?

 

展开阅读全文

If You are my legend

05-22

Problem DescriptionnIf you are my legend------If your are my legend, let it as long as the heaven and earth endure(Sky Long Earth Nine).nn WhereIsHeroFrom loves a girl very much, we call her X Gu Niang. But today they can’t get together because they live in two different provinces and their distance is much farther. Now they want to build a castle for their future. nThe castle is so Complex, See the figure below:nnnn The castle surface is divided into N by M square cells. Some cubes are stacked one upon another over the cells, forming towers. For each cell the number of cubes stacked over it is given in the matrix A. n Now, give A to you , please help them construct their castle, the unit cube represented as shown below: nnnnn nnInputnInput contains integers N , M, (1 <= N, M <= 30)followed by matrix A, row-by-row. The first row describes the cube tower furthest from the viewer, left to right, and the last row -- nearest to the viewer.n nnOutputnOutput must contain a string representation of the table view, with minimal number of lines required to show all cubes. Each line must contain a string of equal length, which is the minimal width required to show all cubes.n nnSample Inputn2 4n2 2 3 2n1 1 2 3n nnSample Outputn************+---+****n***********/ /|****n**********+---+---+**n****+---+-| / /|-+n***/ / | +---+ |/|n**+---+---+-| | + |n**| | / | |/| +n**| | +---+---+ |/|n**+---+-| | | + |n*/ / | | |/| +n+---+---+---+---+ |/*n| | | | | +**n| | | | |/***n+---+---+---+---+****n 问答

Can you answer these queries?

06-15

Problem DescriptionnA lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of endurance. For every attack of our secret weapon, it could decrease the endurance of a consecutive part of battleships by make their endurance to the square root of it original value of endurance. During the series of attack of our secret weapon, the commander wants to evaluate the effect of the weapon, so he asks you for help.nYou are asked to answer the queries that the sum of the endurance of a consecutive part of the battleship line.nnNotice that the square root operation should be rounded down to integer.n nnInputnThe input contains several test cases, terminated by EOF.n For each test case, the first line contains a single integer N, denoting there are N battleships of evil in a line. (1 <= N <= 100000)n The second line contains N integers Ei, indicating the endurance value of each battleship from the beginning of the line to the end. You can assume that the sum of all endurance value is less than 263.n The next line contains an integer M, denoting the number of actions and queries. (1 <= M <= 100000)n For the following M lines, each line contains three integers T, X and Y. The T=0 denoting the action of the secret weapon, which will decrease the endurance value of the battleships between the X-th and Y-th battleship, inclusive. The T=1 denoting the query of the commander which ask for the sum of the endurance value of the battleship between X-th and Y-th, inclusive.n nnOutputnFor each test case, print the case number at the first line. Then print one line for each query. And remember follow a blank line after each test case.n nnSample Inputn10n1 2 3 4 5 6 7 8 9 10n5n0 1 10n1 1 10n1 1 5n0 5 8n1 4 8n nnSample OutputnCase #1:n19n7n6 问答

can you help me? thanks for you

12-26

#include "stdafx.h"rn#include "resource.h"rn#include "math.h"rn#include "string.h"rnrn#define MAX_LOADSTRING 100rn#define MAX_DEVICES 100rn#define MAX_NUM 10000rn#define PANE_CONS 100 //网格密度rn#define PI 3.1415927rnstatic int crSet[2];rnstatic int CurrentVal[2],PrevVal[2];rnstatic HWND hwScroll[2];rnchar szString[10];rnHINSTANCE hInst;rnHWND hWnd;rnTCHAR szTitle[MAX_LOADSTRING]; // The title bar textrnTCHAR szWindowClass[MAX_LOADSTRING]; // The title bar textrnATOM MyRegisterClass(HINSTANCE hInstance);rnBOOL InitInstance(HINSTANCE, int);rnLRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);rnLRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);rnLRESULT CALLBACK SETDlgProc(HWND, UINT, WPARAM, LPARAM);rnrnint APIENTRY WinMain(HINSTANCE hInstance,rn HINSTANCE hPrevInstance,rn LPSTR lpCmdLine,rn int nCmdShow)rnrn MSG msg;rn HACCEL hAccelTable;rn LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);rn LoadString(hInstance, IDC_WINDOWTEST, szWindowClass, MAX_LOADSTRING);rn MyRegisterClass(hInstance);rn if (!InitInstance (hInstance, nCmdShow)) rn rn return FALSE;rn rnrn hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_WINDOWTEST);rn SendMessage(hWnd,WM_COMMAND,IDM_START,0L);rn while (GetMessage(&msg, NULL, 0, 0)) rn rn if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) rn rn TranslateMessage(&msg);rn DispatchMessage(&msg);rn rn rnrn return msg.wParam;rnrnATOM MyRegisterClass(HINSTANCE hInstance)rnrn WNDCLASSEX wcex;rnrn wcex.cbSize = sizeof(WNDCLASSEX); rnrn wcex.style = CS_HREDRAW | CS_VREDRAW;rn wcex.lpfnWndProc = (WNDPROC)WndProc;rn wcex.cbClsExtra = 0;rn wcex.cbWndExtra = 0;rn wcex.hInstance = hInstance;rn wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_WINDOWTEST);rn wcex.hCursor = LoadCursor(NULL, IDC_ARROW);rn wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);rn wcex.lpszMenuName = (LPCSTR)IDC_WINDOWTEST;rn wcex.lpszClassName = szWindowClass;rn wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);rnrn return RegisterClassEx(&wcex);rnrnrnrnBOOL InitInstance(HINSTANCE hInstance, int nCmdShow)rnrn HWND hWnd;rnrn hInst = hInstance; // Store instance handle in our global variablernrn hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,rn CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);rnrn if (!hWnd)rn rn return FALSE;rn rn crSet[0]=25;rn crSet[1]=0;rn CurrentVal[0]=25;rn CurrentVal[1]=2;rnrn ShowWindow(hWnd, nCmdShow);rn UpdateWindow(hWnd);rnrn return TRUE;rnrnrnLRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)rnrn int wmId, wmEvent;rn PAINTSTRUCT ps;rn HDC hdc;rn TCHAR szHello[MAX_LOADSTRING];rn LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);rnrn static HPEN hPen,hpen1,hpen2;rn POINT Points[MAX_NUM];rn static int cxClient,cyClient;rn int x,y;rn int i;rnrn switch (message) rn rn case WM_CREATE:rn hpen1=CreatePen(PS_SOLID,3,RGB(0,0,0));rn hpen2=CreatePen(PS_SOLID,1,RGB(255,0,0));rn CurrentVal[0]=25;rn CurrentVal[1]=2;rn break ;rn case WM_SIZE:rn cxClient=LOWORD(lParam);rn cyClient=HIWORD(lParam);rn break;rn case WM_COMMAND:rn wmId = LOWORD(wParam); rn wmEvent = HIWORD(wParam); rn switch (wmId)rn rn case IDM_ABOUT:rn DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);rn break;rn case IDM_SETTING:rn DialogBox(hInst,(LPCTSTR)IDD_CHANGE,hWnd,(DLGPROC)SETDlgProc);rn break;rn case IDM_START:rn hdc=BeginPaint(hWnd,&ps);rn for(x=cxClient/PANE_CONS; xMAX_FREQUENT)rn CurrentVal[i]=MAX_FREQUENT;rn rn if(i==1)rn rn if(CurrentVal[i]>MAX_HUDU)rn CurrentVal[i]=MAX_HUDU;rn rn break;rn case SB_LINELEFT:rn CurrentVal[i]--;rn if(i==0)rn rn if(CurrentVal[i] 论坛

没有更多推荐了,返回首页