1, write script/root/bin/systeminfo.sh, display the current host system information, including hostname, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size2, scripting/root/bin/backup.sh, can be implemented daily/etc/directory backup to/root/etcyyyy-mm-dd3. Write script/root/bin/disk.sh, showing the maximum space utilization value in the current hard disk partition4. Write Script/root/bin/links.sh, show the IPV4 address and connection number of each re
respectively;#!/bin/bash#J=0O=0For I in ' seq 1 ';d oIf [$ ($I%2) = 0]; Thenj=$[$J + $I]Elseo=$[$O + $I]FiDoneecho "SUM J is $J"echo "SU O is $O"=====================================================================Write a script that shows all the default shell-bash users and default shell-/sbin/nologin users on the current system, and counts the total number of users under each shell. The results appear as follows:Bash,3users,they is:Root,redhat,gentooNologin, 2users, they is:Bin,ftpcan be app
sometimes referred to as "The simplest, impossible mathematical problem". Remember to convert the return value of input () to an integer using the INT function, or it will be a string. Tip: If number% 2 = = 0, integer number is even. If number% 2 = = 1, it is odd. """defCollatz (number):ifNumber = = 1: return1elifNumber% 2 = =0:numbers= number//2Print(Numbers) Collatz (numbers)elifNumber% 2 = = 1: Numbers= 3*number + 1Print(Numbers) Collatz (numbers)Try: number= Int (Input ("Please enter
1, P168A complete terminal output selection menu for the program.#include 1, P171A program that detects keystroke events.#include "Fourth edition of Linux Programming", chapter fifth of the exercises
";If the file is a directory, it is displayed as "directory";If the file is a linked file, it is displayed as "symbolic file";Otherwise, it is displayed as "unknown type."#!/bin/bashif[!-e$1];thenecho "FILENBSP;NOTNBSP;EXITNBSP;." exit5fiif[-L$1];thenecho "Symbolicfile." elif[-d$1];thenecho "directory." elif[-f$1];thenecho "Regularfile." elseecho "Unknowntype." Fi run Result: [[Emailprotected]test]#sh20.sh/etc/directory. [[emailprotected]test]#sh20.sh/etc/rc.d/rc1.d/k92iptables symbolicfile. [[
#!python3#9.8.1#遍历目录树,查找特定扩展名的文件(自定义)#and把查找到的文件,copy到新文件夹import os,shutilfile_dir=input("输入要查找的目录:")file_dir=os.path.abspath(file_dir)file_list=[]if not os.path.exists(file_dir): print("目录不存在")else: file_type=input("输入要查找文件类型的扩展名(如.pdf或.jpg):") file_type=file_type.lower() for folder,subfolders,files in os.walk(file_dir): for fi in files: if fi.lower().endswith(file_type): file_list.append( os.path.join(folder,fi))#复制destination=input("输入要存放文件的目录:")destination=os.path.abspath(destination)if not
valueSecond, complete the main methodTips: 1, call the custom method, save the method return value in the variable maxscore 2, output variable result1 Public classHelloWorld {2 3 //complete the Main method4 Public Static voidMain (string[] args) {5 6 //Create object, object named Hello7HelloWorld Hello =NewHelloWorld ();8 9 //calling a method and saving the return value in a variableTen intMaxscore =hello.getmaxage (); One A
;//boolean b2=s1Fourth. Exercise 1: (1) write a program that prints values from 1 to 100public static void Main (string[] args) {test (100);} public static void Test (int num) {int i=0;while (iExercise 2: (2) write a program that generates 25 random numbers of type int, and for each random number, use the If-else statement to classify it as greater than, less than, or equal to a randomly generated value immediately following it.public static void Main (string[] args) {test ();} public static voi
Tags: images com history ges hint color user input sha. comguess the number game. First let the system randomly generate a number, give the number a range (1-60), let the user enter the guessing number, the input is judged, if not meet the requirements, give high or low hint, guess the right after the number of guesses to use, And based on the guessing history gives the user a beat percentage of what has been guessed, and puts the key content in a special color to prompt users. The final results
inferred prime number, and use the function to implement these two functions.
(2) Draw a flowchart of the banking system (the detailed business point ends, not all)
Note: in traditional teaching, if you have not learned to write code, you must first learn the painting process. In practice, I felt that the effect was not good. Controls why the structure is dizzy and how it can be drawn. There is a certain programming experience before painting, is t
At this point, the basic knowledge of C language has been basically finished, but you will find that the C language, but you can not do anything, when I learned here is also the case, learning programming is a long process, the front is just the foundation of programming language, there will be a long way to go, and hope to continue.Here, we do some small program practice, and then the large program is also
3D Game Programming with directx 11 exercises answer 8.2, programming8.2Chapter 8 Question 2
1. First find the Directx Texture Tool, which is located in
Introduction to 3D game programming with directx 11
Compared with the basic content of longshu, The DX11 feeling is quite different this time. Algebra has gone through it in detail, and the original Amazon i
(fname, fn);} void Person: Show () const {cout
10.3 compile the golf class, including the name and Score data, and call
// 10.3 write the golf class, including the name and Score data, and call # include
# Include
Using namespace std; const int Len = 40; class golf {string fullname; int handicap; public: golf (): fullname ("no"), handicap (0) {} golf (const char * name, int hc) {fullname = name; handicap = hc;} void showgolf () {cout
10.4 perform
After registering deep learning on Cousera, you can download the after-class exercise.1. After entering the programming environment, click File-open in the upper left corner to enter the file management mode2. Click on the Red Circle folder to enter the root directory3. In the top right corner of the root directory, new one IPYNB4. Open the new IPYNB, enter and do the following, you can compress the files in the root directory into a zip format, downl
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.