⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cpp

📁 Visual C++ syntex testing codes for Window XP
💻 CPP
字号:

/*
#include <stdio.h>

////////// Array test programme //////////////////
void main() {
	int arr[3], i;

	for (i=0;i<3;i++) {
		arr[i]=i;
		printf("%d\n",arr[i]);
	}
}
*/

/*
#include <stdio.h>

////////// Array test programme //////////////////
void main() {
	int arr[3]={1,2,3}, i;

	for (i=0;i<3;i++) {
		printf("%d\n",arr[i]);
	}
}
*/

///////// data type: byte /////////////////
///////// test programme ///////////////// 


/*
#include <afxdisp.h>	// MFC Automation classes

void main() {
	byte i=0x80;

	printf("%d",i);

}
*/

/*
#include <afxdisp.h>	// MFC Automation classes

void main() {
	byte i=0x80;

	printf("%d\n",i);
	i &= 0xfe;
	printf("%d\n",i);
}

*/

/*
#include <afxdisp.h>	// MFC Automation classes

void main() {
//	byte i, j, k;
	
byte	i=0x81, j=0xb0,	k=0x08;

	printf("%d\n",i);
	i &= 0xfe;
	printf("%d\n",i);
	if (i < j) printf("%d is smaller than %d\n",i, j);
	if (i > k) printf("%d is bigger than %d\n",i, k);
}

*/
/*
#include <stdio.h>
void main() {
	int i;

	for (i=0;i<8;i++) {
		printf("%d\n", i);
	}
}
*/
/*
#include <afxdisp.h>

void main() {
byte inbyte=0, result;

//	result = Inp32(STAT_PORT) & 0x10; // bit 4
	
	result = inbyte & 0x10;
	if (result != 0)
		inbyte = inbyte | 0x01;
	else
		inbyte = inbyte & 0x0fe;
	printf("%d\n", result);

	inbyte=0x10;
	result = inbyte & 0x10;
	if (result != 0)
		inbyte = inbyte | 0x01;
	else
		inbyte = inbyte & 0x0fe;
	printf("%d\xnnn", result);

}


#include <afxdisp.h>

void main() {
byte  result;
int inbyte=-1;
//	result = Inp32(STAT_PORT) & 0x10; // bit 4
	
	result = inbyte & 0x10;
	if (inbyte)
		printf("%d is true\n", inbyte);
	else
		printf("%d is false\n", inbyte);


	inbyte=0;
	if (inbyte)
		printf("%d is true\n", inbyte);
	else
		printf("%d is false\n", inbyte);

}


#include <afxdisp.h>

void show_int (int *ptr) {
	printf("the value of arr[0] is %d\n", *ptr);
	ptr++;
	printf("the value of arr[1] is %d\n", *ptr);
	ptr++;
	printf("the value of arr[2] is %d\n", *ptr);
}

void main() {
	int arr[3]={0,1,2};

	show_int(arr);	
}

*/
/*
#include <afxdisp.h>

void change_int (int *ptr) {
	*ptr = 3;
	ptr++;
	*ptr = 2;
	ptr++;
	*ptr = 1;
}

void main() {
	int arr[3]={0,1,2};

	printf("the value of arr[0] is %d\n", arr[0]);
	printf("the value of arr[1] is %d\n", arr[1]);
	printf("the value of arr[2] is %d\n", arr[2]);
	change_int(arr);	
	printf("the value of arr[0] is %d\n", arr[0]);
	printf("the value of arr[1] is %d\n", arr[1]);
	printf("the value of arr[2] is %d\n", arr[2]);
}
*/
/*
#include <afxdisp.h>
#define BoundsCheck(a) if (a<5) a=5; if (a>10) a=10;

void main() {
	int a=0;

	BoundsCheck(++a);
	printf("%d\n", a);

	a=3;
	printf("%d\n", a);
	if (++a <4) printf("The answer is %d\n", a);
	if (++a >=4) printf("The answer is %d\n", a);

}

#include <afxdisp.h>
//#define BoundsCheck(a) if (a<5) a=5; if (a>10) a=10;

void main() {
	int i, a=0;

	for (i=0; i<33; i++) {
		printf("%d,    %d,    %d\n", i,i*8/3-1,i*8/3);
	}


}


#include <stdio.h>
//#define BoundsCheck(a) if (a<5) a=5; if (a>10) a=10;

void main() {

	printf("Y   Y IIIII PPPP\n");
	printf(" Y Y    I   P   P\n");
	printf("  Y     I   P   P\n");
	printf("  Y     I   PPPP\n");
	printf("  Y     I   P\n");
	printf("  Y     I   P\n");
	printf("  Y   IIIII P\n");

}
*/
#include <stdio.h>
//#define BoundsCheck(a) if (a<5) a=5; if (a>10) a=10;

int main() {
	char a='Y', b='I', c='P',d=' ';
	char first_name[]={ a, ' ', ' ', ' ', a, ' ', b, b, b, b, b, ' ', c, c, c, c, ' ',
						' ', a, ' ', a, ' ', ' ', ' ', ' ', b, ' ', ' ', ' ', c, ' ', ' ', ' ', c,
						' ', ' ', a, ' ', ' ', ' ', ' ', ' ', b, ' ', ' ', ' ', c, ' ', ' ', ' ', c,
						' ', ' ', a, ' ', ' ', ' ', ' ', ' ', b, ' ', ' ', ' ', c, c, c, c, ' ',
						' ', ' ', a, ' ', ' ', ' ', ' ', ' ', b, ' ', ' ', ' ', c, ' ', ' ', ' ', ' ',
						' ', ' ', a, ' ', ' ', ' ', ' ', ' ', b, ' ', ' ', ' ', c, ' ', ' ', ' ', ' ',
						' ', ' ', a, ' ', ' ', ' ', b, b, b, b, b, ' ', c, ' ', ' ', ' ', ' '};
	int i, j;

	for (i=0; i<7; i++) {
		for (j=0; j<17;j++) printf("%c",first_name[i*17+j]);
		printf("\n");
	}

	//printf("Y   Y IIIII PPPP\n");
//	printf(" Y Y    I   P   P\n");
//	printf("  Y     I   P   P\n");
//	printf("  Y     I   PPPP\n");
//	printf("  Y     I   P\n");
//	printf("  Y     I   P\n");
//	printf("  Y   IIIII P\n");
	return 0;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -