首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看全站
import java.text.DecimalFormat;
import java.util.HashSet;
import java.util.Iterator;

class Book{
    private String bookName;
    private String author;
    private double price;
    
    public Book(String bookName, String author, double price){
        this.bookName = bookName;
        this.author = author;
......................
阅读全部 | GunL 贴于 2021年12月10日 22:54     hide bbsi
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;

public class CollectionTest // 创建一个CollectionTest类
{
public static void main(String[] args) {
Collection westList = new ArrayList(); // 用ArrayList实现Collection接口
// 使用add()方法向集合c中添加元素
westList.add("唐僧");
westList.add("孙悟空");
......................
阅读全部 | GunL 贴于 2021年12月10日 18:34     hide bbsi
import java.util.ArrayList;
import java.util.List;

public class Main{
    public static void main(String args[]){
        List<String> list = new ArrayList<String>(); //使用ArrayList实现List接口
        //使用add()方法向集合List添加元素
        list.add("《三国演义》");
        list.add("《莎士比亚诗选》");
        list.add("《红楼梦》");
        System.out.println("书架上的书籍:" + list);  // 输出集合list中的元素
        List<String> desk = new ArrayList<String>();  // 使用LinkList实现List接口
......................
阅读全部 | GunL 贴于 2021年12月10日 16:46     hide bbsi
import java.util.ArrayList;
import java.util.List;

public class Main{
    public static void main(String args[]){
        System.out.println("----------------NBA历史十大巨星-----------------\n");
        String titles[] = {"球员","绰号","得分","篮板","助攻"};  //声明一个String类型的数组,用来存放数据信息
        for(int i = 0; i < titles.length; i++){  //遍历数组titles
            System.out.print(titles[i] + "\t");  //输出数组中的元素
        }
        System.out.println();
        List<String> list = new ArrayList<String>();  //使用ArrayList实现List接口
......................
阅读全部 | GunL 贴于 2021年12月10日 16:26     hide bbsi
import java.util.ArrayList;
import java.util.List;

class Main{                                      //定义类Main
    public static void main(String args[]){      // 主方法
        List<String> list = new ArrayList<String>();  //创建集合对象
        list.add("a");               //向集合中添加元素
        list.add("b");
        list.add("c");
        int i = (int)(Math.random()*list.size()); //获取0~2之间的随机数
        System.out.println("随机获取集合中的元素:" + list.get(i));
        list.remove(2);  //将指定索引位置的元素从集合中移除
......................
阅读全部 | GunL 贴于 2021年12月10日 15:51     hide bbsi
import java.util.*;

public class Muster{
    public static void main(String args[]){
        Collection<String> list = new ArrayList<String>();
        list.add("《Java从入门到精通》");
        list.add("《零基础学Java》");
        list.add("《Java精彩编程200例》");
        Iterator<String> it = list.iterator();
        while(it.hasNext()){
            String str = it.next();
            System.out.println(str);
......................
阅读全部 | GunL 贴于 2021年12月10日 15:34     hide bbsi
/**
WASD移动
P放置木板
如果在水下移动会扣血
当LVEVL达到64时游戏通关
**/
#include <bits/stdc++.h>
#include <cstdlib>
#include <time.h>
#include <cmath>
#include <iostream>
#include <fstream>
......................
阅读全部 | ghost_no_eq 贴于 2021年12月9日 19:32     hide bbsi
Option Explicit
' By音符,QQ:337855632 Time:2020-03-17 功能定制:20元起
Const C_GameWith = 1024
Const C_GameHeight = 768
Const C_GameSmallWith = 320
Const C_GameSmallHeight = 240
'黑带   16  20
Dim GamehWnd, dm, AppName, config, bgkms, KMData
config = ".\Angel.ini"
AppName = "Angel_BP"
Function CmpMutlColor(Args, Sleep)
    Dim i
......................
阅读全部 | angelfly 贴于 2021年12月6日 14:44     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绘制一个心形图案:");
......................
阅读全部 | Walter2021 贴于 2021年12月2日 18:52     hide bbsi
#include <stdio.h>
#include <stdlib.h>


int rand2(int min, int max)
{
    static unsigned long long z = 1, d = 0, s = 0, i = 256;
    static unsigned char* zz = (unsigned char*)&z, * dd = (unsigned char*)&d, *ss = (unsigned char*)&s;
    if ((++i) >= 256) { if (d) free((void*)d); d = (unsigned long long)malloc(8); i = 0; }        // 產生隨機堆位址到d
    z = z * 17 + 139;        // 線性求餘法產生0~256之間的隨機數到z
    ss[0] = zz[0] + dd[0] + dd[7] + ss[3];        // 隨機數和堆位址混合到ss
    ss[1] = zz[1] + dd[1] + dd[6] + ss[0];
......................
阅读全部 | udefine 贴于 2021年11月29日 19:43     hide bbsi
上一页 62 63 64 65 66 67 68 69 70 71 下一页