Linux下完成的一个作业程序
文档创建日期:2010-02-19
01 // P173: 2.编程题 (7)
02
03 // The beginning of C program: test06-07.c.
04
05 // Header files included.
06 #include <stdio.h>
07
08 // Macro definition.
09 #define MAX_SIZE 100
10
11 // No.1: Subroutine: float rounding ( float f_num );
12 float rounding ( float f_num )
13 {
14 long int temp=0;
15 temp = (long int) (f_num * 100);
16 temp = (long int) ((f_num*100 - temp)*2 + temp);
17 f_num = temp / 100.0;
18
19 return (f_num);
20 }
21
22 // No.2: Subroutine: void select_sort ( float list[], int size ); 选择排序子函数
23 void select_sort ( float list[], int size )
24 {
25 int i, j, min;
26 float temp=0.0;
27 for ( i=0; i<size-1; i++ )
28 &
相关文档:
Linux文件查找命令find,xargs详述
一、find 命令格式
1、find命令的一般形式为;
find pathname -options [-print -exec -ok ...]
2、find命令的参数;
pathname: find命令所查找的目录路径。例如用.来表示当前目录,用/来表示系统根目录。
-print: find命令将匹配的文件输出到标准输出。
-exec: find命令对 ......
public class Test {
public static void main(String aa[]) {
if (System.getProperty("os.name").equals("Linux")) {
System.out.println("linux");
} else if (System.getProperty("os.name").equals("Windows XP")) {
System.out.println("win ......
花了一个周末的时间列出来的。共享出来,希望大家花几分钟看看。这也算是LINUX下比较实用的查找方式了
which(寻找“执行文件”)
[root@localhost home]# which [-a] command
-a : 将所有可找到的命令均列出,而不仅仅列出第一个找到的命令名称
范例:
[root@localhost home]# which passwd
/usr/bin/passwd ......
Linux下关机最要有以下方法,我想这些方法足以满足你的需要:
[root@localhost /]# shutdown [-t秒] [-arkhcncfF] [时间] [提示信息]
[root@localhost /]# shutdown -h 10 'I will shutdown after 10 mins'
-t sec : -t 后加秒数,即‘过几秒钟后关机’的意思。
-k : 不要真的关机,只是发送提示信息。
......
ICW2 用于设置芯片送出的中断号的高5位。什么意思呢,就是说从中断控制器发出的中断信号的高5位就是在ICW2里设置的。
在linux 0.11里系统把主片的ICW2设置为0x20,就表示中断请求IR0~IR7中断号的范围是0x20~0x27(8259A芯片产生的IRQ号必须是连续的,所以也只需要设置起始号就ok了!) ......