上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 90 下一页
摘要: 题目: 编写个shell脚本将当前目录下大于10K的文件转移到/tmp目录下。 答案: #!/bin/bash for FileName in `ls -l | awk '$5>10240 {print $9}'`; do mv $FileName /tmp done ls -al /tmp 阅读全文
posted @ 2020-01-05 13:38 王清河 阅读(150) 评论(0) 推荐(0)
摘要: 重载:指的是同一可访问区被声明的几个具有不同参数列(参数的类型,个数,顺序不同)的同名函数,根据参数列表确定调用哪个函数。重载不关心函数返回类型。 class A { public: void test{int i}; //overload void test(double i); //overlo 阅读全文
posted @ 2020-01-04 18:07 王清河 阅读(608) 评论(0) 推荐(0)
摘要: 题目: 文件移动拷贝,有m1.txt m2.txt m3.txt m4.txt,分别创建出对应的目录,m1 m2 m3 m4 并把文件移动到对应的目录下。 答案: #!/bin/bash touch m1.txt m2.txt m3.txt m4.txt I=1 while [ $I -le 4 ] 阅读全文
posted @ 2020-01-04 14:51 王清河 阅读(201) 评论(0) 推荐(0)
摘要: 题目: 编写一个的脚本,它包括以下内容 a) 包含一段注释,列出您的姓名、脚本的名称和编写这个脚本的目的。 b) 问候用户。 c) 显示日期和时间。 d) 显示这个月的日历。 e) 显示您的机器名。 f) 显示当前这个操作系统的名称和版本。 g) 显示父目录中的所有文件的列表。 h) 显示root正 阅读全文
posted @ 2020-01-04 14:43 王清河 阅读(212) 评论(0) 推荐(0)
摘要: 上线左右或者wasd移动,q或Q退出 /* 2048.c */ #include<stdio.h> #include<stdlib.h> #include<curses.h> #include<unistd.h> #include<signal.h> #include<time.h> int a[4 阅读全文
posted @ 2020-01-03 15:26 王清河 阅读(354) 评论(0) 推荐(0)
摘要: 题目: 编写shell脚本获取本机的网络地址。 答案: #!/bin/bash IP=`ifconfig | grep "inet addr" | sed '/127/d' | awk '{print $2}' | awk -F : '{print $2}'` MASK=`ifconfig | gr 阅读全文
posted @ 2020-01-03 11:15 王清河 阅读(189) 评论(0) 推荐(0)
摘要: 前置步骤(安装依赖库): sudo apt-get update sudo apt-get install build-essential sudo apt-get install libgl1-mesa-dev sudo apt-get install libglu1-mesa-dev $sudo 阅读全文
posted @ 2020-01-03 10:57 王清河 阅读(3990) 评论(0) 推荐(2)
摘要: 题目:写一个shell脚本来得到当前的日期,时间,用户名和当前工作目录 答案: 解析:$LOGNAME 获取登录用户名 date 获取当前时间 who i am 获取用户名,用户数据所在磁盘号,以及日期和ip地址 pwd获取当前文件所在路径 注意点: 如果系统应用了中文语言包的话,who i am 阅读全文
posted @ 2020-01-03 10:46 王清河 阅读(217) 评论(0) 推荐(0)
摘要: 有两个文件如下所示: employee.txt 100 Jason Smith 200 John Doe 300 Sanjay Gupta 400 Ashok Sharma bonus.txt 100 $5,000 200 $500 300 $3,000 400 $1,250 employee.tx 阅读全文
posted @ 2020-01-02 17:36 王清河 阅读(217) 评论(0) 推荐(0)
摘要: 所谓大数,就是超过longlong表示的位数。 #include<stdio.h> #include<stdlib.h> #include<string.h> #define BASE (10) #define MAX(x, y) ((x) > (y) ? (x) : (y)) typedef st 阅读全文
posted @ 2020-01-02 15:18 王清河 阅读(2428) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 90 下一页