连击 天
fork: star:
#include <stdio.h> #include <netdb.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <netinet/in.h> #include...
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ FILE *fp; char str[102] = {0}, strTemp[100]; if((fp=fopen("testfile", "a+")) == ...
fgets() 函数用来从指定的文件中读取一个字符串,并保存到字符数组中,它的原型为: char *fgets ( char *str, int n, FILE *fp ); str 为字符数组,n 为要读取的字符数目,fp 为文件指针。 ...
#include <stdio.h> #include <stdlib.h> int main(){ FILE *fp; char ch; if((fp=fopen("testfile", "a")) == NULL){ fprintf(stderr, "Error opening f...
1)牛顿法求平方根: 公式:(y + x/y) / 2,首先猜测为1,然后逐渐逼近。 (defun sqrt-iter (guess x) (if (good-enough? guess x) guess (sqrt-iter (...
1)简单的宏 CL-USER> (defmacro print-test (x y) `(format t "~A ~A~%" ,x ,y)) PRINT-TEST CL-USER> (print-test 'hello 'world) HELLO WORLD NIL 2) 3)...
1)用sort函数进行排序 CL-USER> (sort "elbow" #'char<) "below" CL-USER> (sort '(a c b s) #'string<) (A B C S) CL-USER> (sort '(39 48 28 4 32) #'<) (4 28 32 ...
集合论中的并集 (union)、交集 (intersection)以及补集 (complement)的实现,是由函数 union 、 intersection 以及 set-difference 。还有判断数组蕴涵subsetp CL-USER> (setf list1 '(a...
1)用make-array创建数组: CL-USER> (make-array 5 :initial-element nil) #(NIL NIL NIL NIL NIL) CL-USER> (make-array 5 :initial-contents '(a e i o u)) #(A E I O...
1)读取文件 用with-open-file函数打开文件 CL-USER> (defun my-read-file () (with-open-file (stream "d:/test.lisp") (do ((my-file (read-line ...
循环: 1)do循环 语法:(do ((变量名 变量初值 (变量变化语句))) (结束条件 返回值) 循环主体) CL-USER> (defun draw-line (x) (do ((i 0 (1+ i))) ...
1)基本的数学函数: + Adds two numbers - Subtracts the second number from the first * Multiplies two numbers / Divides the first number by the second ABS Absolute value of a numb...
package pratise; class Quicksort{ //set up a call to the actual Quicksort method. static void qsort(char items[]){ qs(item...
package pratise; public class Construct { public static void main(String[] args) { int sum = 0; int nums[][] = new int...
#! /usr/bin/perl use strict; use warnings; use LWP::Simple qw(get); my $html = get("http://www.baidu.com"); print $html; 把网页源代码保存到本地: #! /usr/bin/perl use...
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <winsock2.h> #pragma comment(lib, "ws2_32.lib") int geturl(char *url) { /****************解...
没有更多内容
加载失败,请刷新页面
文章删除后无法恢复,确定删除此文章吗?
动弹删除后,数据将无法恢复
评论删除后,数据将无法恢复