这里要用到date函数的第三种形式,下面是获得当前日期(set 'today (date (date-value) 0 "%Y%m%d"))
(date-value) 返回的是1970年0点累计的秒数,作为date函数的地一个参数第二个参数是偏移的分钟,0表示没有偏移,就是现在。 这个参数主要用来做时区转换第三个参数定义日期格式,参考下表:formatdescription%aabbreviate...
本题要求根据火车的出发时间和达到时间,编写程序计算整个旅途所用的时间。
输入格式:
输入在一行中给出2个4位正整数,其间以空格分隔,分别表示火车的出发时间和到达时间。每个时间的格式为2位小时数(00-23)和2位分钟数(00-59),假设出发和到达在同一天内。
输出格式:
在一行输出该旅途所用的时间,格式为“hh:mm”,其中hh为2位小时数、mm为2位分钟数。
输入样例...
在学习计算机组成原理中的指令系统的时候,我们会遇到一个非常经典的技术流水作业。人们一般称这是一种技术,其实我更喜欢把它称为一种思想,它就是我们生活中工厂里流水作业思想在计算机中的运用。...
【题目】
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When s3 = "aadbbbaccc", return false.
【题意】
给定字符串s1,s2,s3, 判断s3是不是s1和s2中的字交叉组合...
【题目】
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only nodes with ke...
Subsets
Total Accepted: 13267 Total
Submissions: 48509My Submissions
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-desc...
【题目】
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n) space is pretty straight forward. Could you devise a constant space solution?
confused what "{1,#,2,3}" ...
【题目】
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
【题意】
判断了两个二叉树是否相等
【思路】
递归...
【题目】
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
But the following is not:
1
/ 2 2
\ 3 3
No...
// OpenGL.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include
#include
#include
using namespace std;
void init(void)
{
glClearColor(1.0,1.0,1.0,1.0);
glClear(GL_COLOR_BUFFER_BIT);
glShadeMod...