First.txtThe adjective Panada walked to the NOUN and then VERB. AnerbyNOUN was unaffected by these events.#!python3#-*- coding:utf-8 -*-#8.9.2疯狂填词游戏#用户自定义词语,修改打开文件中的ADJECTIVE、NOUN、VERBimport ref=open(‘first.txt‘,‘r+‘)files=f.read()print(files)f.close()changelist=[‘ADJECTIVE‘,‘NOUN‘,‘VERB‘]for i in changelist: change_reg=re.compile(r‘%s‘ % i) text=input("Enter a %s :" % i) files=change_reg.sub(text,files)fi_2=open(‘third.txt‘,‘w‘)fi_2.write(files)fi_2.close()"Python
1, P103A directory scanner. #include 2, P112Use the MMAP function program to modify the contents of the file, map the file to memory, and change it as an array!#include The exercises in the third chapter of the fourth edition of Linux programming
1, P128A program that gets the date-time format to get the date of the time.#include 2, P130, 132A program that creates temporary files, obtains user information, and outputs logs.#include 3, P141A resource that restricts the CPU consumption of the program.#include "Fourth edition of Linux Programming", chapter Fourth of the exercises
Use the pointer function to traverse the following arrays:$arr = $arr =[1, ' =>true,24=> ' Harry Potter ', ' ' = ' and ' JavaScript ', ' class ' = ' English '];Reference:Task1. Output array2. Iterate through the array before3. Traversing the array from the back forwardPHP//Defining Arrays$arr=[1, ' ' = =true,24=> ' Harry Potter ', ' ' + ' javascript ', ' class ' = ' 中文版 '];//which output function does the output array use? Echo' ; Print_r($arr);Echo' ;//iterating through an array from the GO//Fi
"/>5. Write a shell script that intercepts the first column in the line containing the keyword ' abc ' in the file Test.log (assuming the delimiter is ":"), then sorts the intercepted numbers (assuming the first column is a number) and prints out the columns with more than 10 repetitions;650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/AF/wKioL1XW09LgcsqDAAE3Do3V-9M733.jpg "title=" 5.jpg " alt= "Wkiol1xw09lgcsqdaae3do3v-9m733.jpg"/>6. Write the shell script to determine whether the
Because it is also the way of learning, first draw ideas, code and look at the learning of others, the final is based on the idea of completion, may be relatively simple, late in to improve and changeThe above is a simple classSend a successfulIn the process of writing a few problems encountered, according to the URL of the request is not the same, the request header stitching also needs to change, here the requested URL is http://www.cnblogs.com/mvc/PostComment/Add.aspx static connection, all p
Create or Replace procedurePr_first is--a variableV_avarchar2( -) := 'Someday my life will come to an end';--a constantC_B constantvarchar2( -) := 'and you will be crowned king!'; V_XINGM t_hq_ryxx.xingm%Type;type Ty_ry isrecord (v_nianl t_hq_ryxx.nianl%Type,v_gongz Number(Ten,2)); V_ry Ty_ry;v_ryrow t_hq_ryxx%RowType;begin SelectXingm intoV_xingm fromT_hq_ryxxwhereRowNum= 1;d Bms_output.put_line ('protagonist is' ||v_xingm);SelectNianl,gongz intoV_ry fromT_hq_ryxxwhereRowNum= 1;d bms_output.pu
: he is a girl If it is a character other than b/b/g/g, it is displayed: I don ' t know.#! /bin/bashecho -n your choice:read choicecase in[g,g]Echo "She is a girl. " " "He's a boy. " " ;; *)echo"I don t know. " " ;; Esac6, write the shell script, implement the subtraction operation between the two variables.#! /bin/Bashread-P"imput NUM1:"Aread-P"input num2:"Bread-P"input Operator:"o Case$oinch+) Let"res=a+b"Echo$res;;-) Let"Res=a-b"Echo$res;;/)awk'begin{printf%.2f\n ",'$a'/'$b'}';;*) Let"res=a
already exists, you do not need to create the user by default
Examples of executing scripts:#添加一位叫reeeed教师,3位叫deeeer的学生[[emailprotected] ~]# ./userctr.sh add reeeed deeeer 3User [reeeed] create successfully.reeeed:2bf168User [deeeer1] create successfully.deeeer1:39adcdUser [deeeer2] create successfully.deeeer2:a12201User [deeeer3] create successfully.deeeer3:4088d2#参数不正确时提示[[emailprotected] ~]# ./userctr.sh add 123 321 11Parameter error!#输入不规范时的提示[[emailprotected] ~]# ./userctr.sh add 123
The answer in this blog is not from official resources, but from my own exercises. If you have any questions or errors, please discuss them.
11-1.Parameters. Compare the following three functions:Def countToFour1 ():For eachNum in range (5 ):Print eachNum
Def countToFour2 (n ):For eachNum in range (n, 5 ):Print eachNum
Def countToFour3 (n = 1 ):For eachNum in range (n, 5 ):Print eachNum
What do you think will happen if the following input is given unt
{
public static final int NUM = 3;
public static void Main (String args[]) {
try {
Socket socket = new socket ("127.0.0.1", 4700);
BufferedReader sin = new BufferedReader (new InputStreamReader (system.in));
PrintWriter OS = new PrintWriter (Socket.getoutputstream ());
System.out.println ("Three sides from the client receive triangle sent to the server:");
System.out.println ("Please enter 3 sides:");
String ReadLine = "";
For (int i = 0; i
Os.flush ()
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. [[
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
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.