SET can set the value of symbols; SETQ can set the value of variables; SETF is a macro that will call different function depending on what was called as its first argument. examples (set (quote l) '(1 2 3)) (1 2 3) (set l '(1 2 3)) Failur…
independent flags boolalpha read/write bool elements as alphabetic strings (true and false). showbase write integral values preceded by their corresponding numeric base prefix. showpoint write floating-point values including always the decimal point.…
Ok, Go ahead. 1 (a) (b) (c) (d) 2 注:union 在 Common Lisp 中的作用就是求两个集合的并集.但是这有一个前提,即给的两个列表已经满足集合的属性了.具体的操作过程似乎是对第一个 list 中的每一个元素在第二个 list 中查找,如无则标记一下:待第一个 list 的所有元素在第二个 list 中查完以后将所有标记过的元素放入一个 list 中与第二个 list 进行合并.这意味着,如果刚开始给的两个 list 不完全满足集合的属性,则会有重复出现…
I work out the questions by myself Chapter 2 question 4. (defun greater (x y) (if (> x y) x y ) ) question 5. (a) (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x)) ) ) ) ; to judge whether there is a nil in x (b) (defun myster…
问题描述: 有N条绳子, 它们的长度分别为Li. 如果从它们中切割出K条相同的绳子的话,这K条绳子每条最长能有多少? (备注:答案保留两位小数) <1>精确到小数点后两位输出 #include <iostream> #include <vector> #include <iomanip> using namespace std; int getDiv(vector<int> li, int max){ int ans =0; for(int i=…
# ~/.bashrc: executed by bash(1) for non-login shells.# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)# for examples # If not running interactively, don't do anythingcase $- in *i*) ;; *) return;;esac # don't put dup…
上次,我们探讨了C++关于文件的读操作,这次继续写操作.写,顾名思义,就是把我们自己的东西放到文件中去. 我们举一个简单的例子,就不在乎它的排版问题了. #include<iostream> #include<fstream> using namespace std; int main() { char theme[50]; int year; int month; int day; ofstream outFile; outFile.open("1.txt"…