#include <iostream>
using namespace std;
class Point
{
private:
double x;
double y;
public:
Point(double ix, double iy) :x(ix), y(iy){ cout << "Point Object Constructed." << endl; }
virtual ~Point(){ cout << "Point Object Destructed." << endl; };
virtual void Show() { cout << "x=" << x << ",y=" << y << endl;; }
......................
阅读全部
|
gougoudan
贴于 2020年6月1日 19:48
hide
bbsi
#include <stdio.h>
int main() {
printf("我在编程中国学C语言\n\n");
// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("我爱编程中国 %d 次\n", i);
}
printf("\n\n编程中国送我一颗小心心:");
......................
阅读全部
|
HenryYan
贴于 2020年6月1日 16:56
hide
bbsi
package test;
/**
* 测试局部内部类
*/
public class TestLocalInnerClass {
public void show(){
// 作用域仅限于该方法
class Inner{
public void fun(){
System.out.println("helloworld!");
......................
阅读全部
|
youou3
贴于 2020年5月29日 16:27
hide
bbsi
package test;
public class TestWrapperClass {
public static void main(String[] args) {
//基本数据类型转成包装类对象
Integer a = new Integer(3);
Integer b = Integer.valueOf(30);
//把包装类对象转成基本数据类型
int c = b.intValue();
double d = b.doubleValue();
......................
阅读全部
|
youou3
贴于 2020年5月29日 16:26
hide
bbsi
//010E
#include "stdio.h"
#include "stdlib.h"
int find_repeat_number(int arr[], int n)
{
int ret = -1;
if (n > 1){
char* flagArr = (char*)malloc(sizeof(char)* n);
for (int i = n; i--; flagArr[i] = 0);
for (int i = 0; i<n; ++i){
int number = arr[i];
if (flagArr[number]){
......................
阅读全部
|
gougoudan
贴于 2020年5月26日 09:56
hide
bbsi
//013H
#include "stdio.h"
void str_space_replace(const char* src, char* dst)
{
for (char ch; ch = *src; ++src){
if (' ' == ch){
*dst++ = '%';
*dst++ = '2';
*dst++ = '0';
}
else{
......................
阅读全部
|
gougoudan
贴于 2020年5月26日 09:54
hide
bbsi
#include <stdio.h>
#define SX 10
#define SY 10
struct point
{
short x;
short y;
};
int search(const char m[SX][SX + 1], point path[], int count, const point& endPt);
void main()
{
......................
阅读全部
|
gougoudan
贴于 2020年5月25日 16:22
hide
bbsi
namespace oozinoz1
{
/**/
/// <summary>
/// Class5 的摘要说明。
/// </summary>
public class Class5
{
private static void InsertImage(string imagePath, string wordPath)
{
Document document = new Document();
Section s = document.AddSection();
......................
阅读全部
|
lty666
贴于 2020年5月22日 11:47
hide
bbsi
#include <iostream>
using namespace std;
template <class T>
class DynamicVector
{
T* array; // pointer to the items 指向分配空间的指针
unsigned mallocSize; // number of allocated spaces 分配空间的大小
unsigned numofItems; // number of items 向量内已经存储的元素数量
int virtualZero; // virtual zero 数组起始下标,C语言中通常数组下标是从0开始, 这个数据属性可以让数组的下标从-10或2等等整数开始 ,让数组更加灵活。
public:
......................
阅读全部
|
l1l2l3
贴于 2020年5月21日 17:46
hide
bbsi