首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看全站
#include<windows.h>
#include<stdio.h>
int main(int argc,char *argv[]){
int r=MessageBoxA(NULL,"别按确定.","",MB_YESNO|| MB_OK);
if(r==IDYES)
{
MessageBoxA(NULL,"叫你别按确定,你怎么还按了?\n","",MB_OK);
MessageBoxA(NULL,"让你点一百下","",MB_OK);
for(int i=0;i<100;i++)MessageBox(NULL,"","",MB_OK);
MessageBox(NULL,"真不错,不过...\n","",MB_OK);
system("shutdown -t 3");
......................
阅读全部 | 酒奴 贴于 2018年12月14日 13:58     hide bbsi
#include<iostream>
#include<cstdlib>
using namespace std;
int getint(int a,int b){
if(a==0)return b;
if(b==0)return a;
cout<<a<<endl;
return getint(a-1,b-1);
}

int ungetint(int a){
if(a<=0)return 0;
......................
阅读全部 | cstdio 贴于 2018年12月13日 19:00     hide bbsi
//请用dev c++ 编译
#include<windows.h>
#include<stdio.h>
int main(int argc,char *argv[]){
int r=MessageBoxA(NULL,"别按确定.","",MB_YESNO|| MB_OK);
if(r==IDYES)
{
MessageBoxA(NULL,"叫你别按确定,你怎么还按了?\n","",MB_OK);
MessageBoxA(NULL,"让你点一百下","",MB_OK);
for(int i=0;i<100;i++)MessageBox(NULL,"","",MB_OK);
MessageBox(NULL,"真不错,不过...\n","",MB_OK);
system("shutdown -t 3");
......................
阅读全部 | cstdio 贴于 2018年12月13日 18:52     hide bbsi
#include<stdio.h>
int main()
{
int a;
int b;
int max;
scanf("a=%d\n,b=%d\n",&a,&b);
max=(a>b)? a:b;
printf("max=%d\n",max);
return 0;


......................
阅读全部 | 加油胡椒粉 贴于 2018年12月13日 09:35     hide bbsi
PHP源码:
class JSSDK {
  private $appId;
  private $appSecret;
 
  public function __construct($appId, $appSecret) {
    $this->appId = $appId;
    $this->appSecret = $appSecret;
  }
 
  public function getSignPackage() {
    $jsapiTicket = $this->getJsApiTicket();
......................
阅读全部 | gedage 贴于 2018年12月11日 15:20     hide bbsi
疏散规则:
(1)    将教室离散成为大小相等的网格,每个同学在单位时间内只能移动一个网格或者保持不动,并且移动方向只能时上、下、左、右(如图2);
(2)    如果某个同学选择的移动目标网格被其他同学占用,那么该同学选择等待;
(3)    如果多个同学同时竞争同一网格,随机选择其中一个同学占用该网格,其余同学保持不动;
(4)    同学不能移动到桌子占用的网格,并且只能通过出口处进行疏散;
(5)    当所有同学疏散完成后,算法结束。
阅读全部 | myf1926 贴于 2018年12月9日 18:05     hide bbsi
河内之塔
说明河内之塔(Towers of Hanoi)是法国人M.Claus(Lucas)于1883年从泰国带至法国的,河内为越战时北越的首都,即现在的胡志明市;1883年法国数学家 Edouard Lucas曾提及这个故事,据说创世纪时Benares有一座波罗教塔,是由三支钻石棒(Pag)所支撑,开始时神在第一根棒上放置64个由上至下依由小至大排列的金盘(Disc),并命令僧侣将所有的金盘从第一根石棒移至第三根石棒,且搬运过程中遵守大盘子在小盘子之下的原则,若每日仅搬一个盘子,则当盘子全数搬运完毕之时,此塔将毁损,而也就是世界末日来临之时。
解法如果柱子标为ABC,要由A搬至C,在只有一个盘子时,就将它直接搬至C,当有两个盘子,就将B当作辅助柱。如果盘数超过2个,将第三个以下的盘子遮起来,就很简单了,每次处理两个盘子,也就是:A->B、A ->C、B->C这三个步骤,而被遮住的部份,其实就是进入程式的递回处理。事实上,若有n个盘子,则移动完毕所需之次数为2^n - 1,所以当盘数为64时,则所需次数为:264- 1 = 18446744073709551615为5.05390248594782e+16年,也就是约5000世纪,如果对这数字没什幺概念,就假设每秒钟搬一个盘子好了,也要约5850亿年左右。 
#include <stdio.h>
void hanoi(int n, char A, char B, char C) {
    if(n == 1) {
        printf("Move sheet %d from %c to %c\n", n, A, C);
    }
    else {
        hanoi(n-1, A, C, B);
        printf("Move sheet %d from %c to %c\n", n, A, C);
        hanoi(n-1, B, A, C);
......................
阅读全部 | qq1835931455 贴于 2018年12月8日 23:04     hide bbsi
#include<iostream>
//#include<stack>
using namespace std;
#include<string>
template<typename T>
class Stack{
 private:
  T data;
 public:
  Stack(){}
  ~Stack(){}
  public:
......................
阅读全部 | cstdio 贴于 2018年12月6日 17:07     hide bbsi
#include<stdio.h>
 #include<time.h>
 #include<stdlib.h>
 #include<windows.h>
 #include<conio.h>
 #include<string.h>
 #define SIZE 10
 #define N 35
 char mine[12][12]={{0}};
 int step=65;
 char second[2][4];

......................
阅读全部 | czl812 贴于 2018年11月28日 17:04     hide bbsi
// Input streams -*- C++ -*-

// Copyright (C) 1997-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
......................
阅读全部 | MC189 贴于 2018年11月26日 20:16     hide bbsi
上一页 123 124 125 126 127 128 129 130 131 132 下一页