BMW testing (C ++ implementation) and BMW Testing implementation

Source: Internet
Author: User

BMW testing (C ++ implementation) and BMW Testing implementation


 Purpose: To zoom in the editor and narrow down the performance test.

Test Resource: a BMW.

Test results: Good.






Implementation Method: Call the locally saved BMW file to display it in the editor line by line and zoom in and out. Color different symbols.


1. BMW files

{/*LOOKBMW                               _(\_/)                              ,((((^`\                            ((((  (6 \                           ,((((( ,    \      ,,,_              ,(((((  /"._  ,`,     ((((\\ ,...       ,((((   /    `-.-'     )))  ;'    `"'"'""((((   (          (((  /            (((      \     )) |                      |    ((  |        .       '     |    ))  \     _ '      `t   ,.')    (   |   y;- -,-""'"-.\   \/      )   / ./  ) /         `\  \       |./   ( (           / /'       ||     \\          //'|       ||      \\       _//'||       ||       ))     |_/  ||       \_\     |_/          ||       `'"                  \_\                            `'" $—LOOKBMW*/}




2. C ++ implementation


A loads the BMW file and displays it in the editor line by line.

CStdioFile LookBmwFile;CString bwmFilePath = Pack::GetConfigIniFile(_T("GlbBmwFilePath"));if(!LookBmwFile.Open(bwmFilePath, CFile::modeRead | CFile::typeText)){MessageBox(_T("Loading files Error " + bwmFilePath + ", please reinstall the software..."));}CString strBmwTxt;BOOL BwmTxtStart = false;while(LookBmwFile.ReadString(strBmwTxt)){if(BwmTxtStart){if(strBmwTxt == _T("$—LOOKBMW*/}")){break;}CString str;for(int i=0; i<strBmwTxt.GetLength(); i++){str = (strBmwTxt[i]);SendMessages(SCI_ADDTEXT, 1, (LPARAM)(LPCSTR)str);UpdateWindow();Sleep(15);}str = _T("\n");SendMessages(SCI_ADDTEXT, 1, (LPARAM)(LPCSTR)str);}if(strBmwTxt.Trim() == _T("{/*LOOKBMW")){BwmTxtStart = TRUE;}}LookBmwFile.Close();


B. Set the magnification and the magnification. The cycle is three times.

int j=3;int i=5;while(j--){while(i--){SendMessages(SCI_ZOOMIN, 0, 0);UpdateWindow();Sleep(70);}i=15;while(i--){SendMessages(SCI_ZOOMOUT, 0, 0);UpdateWindow();Sleep(70);}i=15;}i=10;while(i--){SendMessages(SCI_ZOOMIN, 0, 0);UpdateWindow();Sleep(70);}



Text/xin original reproduced please indicate the source of http://blog.csdn.net/yxstars/article/details/39205345



How does C language implement multiple groups of tests?

# Include <stdio. h>
# Include <string. h>
Int main ()
{
Char c, s [100];
Int I;
Int letters = 0, space = 0, digit = 0, others = 0;
While (gets (s )! = NULL ){
For (I = 0; I <strlen (s); I ++ ){
C = s [I];
{
If (c> = 'A' & c <= 'Z' | c> = 'A' & c <= 'Z ')
Letters ++;
Else if (c = '')
Space ++;
Else if (c> = '0' & c <= '9 ')
Digit ++;
Else
Others ++;
}
}
Printf ("% d \ n", letters, digit, space, others );
}
Return 0;
}

How to test multiple groups of input data in C Language

# Include <stdio. h>
Void main ()
{
Int n;
While (scanf ("% d", & n )! = EOF, n) // or write it as while (scanf ("% d", & n )! = EOF) then add an if (n = 0) break in the loop;
{
// If (n = 0) break;
If (n/10000 = n % 10) & (n/1000% 10 = n/10% 10) // judge the echo
Printf ("Yes. \ n ");
Else
Printf ("No. \ n ");
}
}

This code should be correct. On OJ, multiple groups of data are processed in this way.

It doesn't matter. This is also true when submitting, because the OJ system puts the input and output data under different folders when judging the answer, as long as the input file runs in your program, the corresponding output file is consistent with its, your program is correct, so you do not need to save the results.
If you really want to do that, use an array to store the answer, and wait until the loop ends, and then print the result.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.