Note_practice
Daria·Saira
这个作者很懒,什么都没留下…
展开
-
190404_Py_example6 (the area of a circle)
Python_example 6program_1 calculate the area of a circlemethod_1_principle method_2_principleconclusion :1.math method compare to computer mind2.use func perf_counter to analyze the code’...原创 2019-04-04 15:24:38 · 213 阅读 · 0 评论 -
C_Euclidean algorithm
最简分式(10分)题目内容:分数可以表示为“分子/分母”的形式。编写一个程序,要求用户输入一个分数,然后将其约分为最简分式。最简分式是指分子和分母不具有可以约分的成分了。如6/12可以被约分为1/2。当分子大于分母时,不需要表达为整数又分数的形式,即11/8还是11/8;而当分子分母相等时,仍然表达为1/1的分数形式。输入格式:输入在一行中给出一个分数,分子和分母中间以斜杠“/”分隔,如:...原创 2019-05-22 15:50:34 · 115 阅读 · 0 评论 -
C_test7.1(array/pointer)_190505
error analyse & reflect:1.情况分析不周全2.学习参考程序中对"输出(待解决问题)"最小分解后处理,防止对情况不周全考虑题目内容:一个多项式可以表达为x的各次幂与系数乘积的和,比如:2x6+3x5+12x3+6x+20现在,你的程序要读入两个多项式,然后输出这两个多项式的和,也就是把对应的幂上的系数相加然后输出。程序要处理的幂最大为100。输入格式:...原创 2019-05-05 21:34:31 · 104 阅读 · 0 评论 -
RUA!ERROR!
Error不可怕解决就是啦(づ ̄3 ̄)づ╭❤~Error 1一个超级经典的错误!overflow栈不空就遍历输出(但是仅遍历是不会导致栈空的所以是典型的while(true)error) push (s,3634); push (s,90); //typical error //hhhhhhhhh(now I'm the girl had the overflow e...原创 2019-04-20 16:21:37 · 141 阅读 · 0 评论 -
Struct_chapter2.2_堆栈
Struct_chapter2.2_堆栈concept引例中缀 : a+bc前缀 : +abc(+) a+*bc --> a+b*c(*) b*c中缀 : a+ b*c - d/e后缀 : abc*+de/-(*) bc* --> b*c(+) abc*+ --> a+b*c(/) de/ --> d/e(-) abc*+de/- -->...原创 2019-04-20 12:33:23 · 214 阅读 · 0 评论 -
190419_c_test6
/* 题目内容:由于计算机内部表达方式的限制,浮点运算都有精度问题,为了得到高精度的计算结果,就需要自己设计实现方法。(0,1)之间的任何浮点数都可以表达为两个正整数的商,为了表达这样两个数的商,可以将相除的结果以多个整数来表示,每个整数表示结果的一位。即商的第一位用一个整数来表示,第二位用另一个整数来表示,以此类推,就可以输出一个高精度的除法结果了。如16/19的结果0.8421052...原创 2019-04-19 13:13:23 · 160 阅读 · 0 评论 -
C_190418_array
C_190418_arrayerror : variably modified at file scopehelp text 1help text 21、#define LISTEN_NUM 10 /*The MAX Number Of Users*/2、const int LISTEN_NUM = 10;/*UserProfile Struct, to store us...原创 2019-04-18 18:16:23 · 204 阅读 · 0 评论 -
Python_190414_test5
Python_190414_test5program1#计算任意个输入数字的乘积def cmul(*a):#notice the use of changeable value s=1 for i in a: s*=i return s #notice the space signs the layer of the program prin...原创 2019-04-14 19:27:44 · 1157 阅读 · 0 评论 -
Py_190417_example_5
get the changeable inputs#prog1 example_5#func 1 get inputdef getinput(): nums=[]#define a viod list iput=input("please input numbers (enter for exit):")#for the firstinput while i...原创 2019-04-17 13:15:08 · 104 阅读 · 0 评论 -
第四章_存储器_课后习题笔记
解题思路(1)机器字长=存储字长=指令字长 (无特殊说明时)218*8b or 256K*8b -> 256KB(2)256/32=8(个)(3)32K*8/4K*4=16(片)(4)16*8=128(片)每个模块板内16,共8个模块板(5)模块号片号片内地址共18位8个模块八组(共16片)RAM3位表示(...原创 2019-04-07 14:51:21 · 290 阅读 · 0 评论 -
C_190412_test5
#include<stdio.h>#include<math.h>//program_1/*我们认为2是第一个素数,3是第二个素数,5是第三个素数,依次类推。现在,给定两个整数n和m,0<n<=m<=200,你的程序要计算第n个素数到第m个素数之间所有的素数的和,包括第n个素数和第m个素数。*/// 2 3 5 7 9//input 2...原创 2019-04-12 15:17:31 · 134 阅读 · 0 评论 -
Program/Algorithm_practice 1.2
Program/Algorithm_practice 1.2利用 online/dynamic array 解决子列最大和问题key pointscan the array by ordernowsum saves the current answermaxsum always saving the max valueand when nowsum is minus ,drop i...原创 2019-04-08 19:59:35 · 131 阅读 · 0 评论 -
chapter 4.3 cache -- 主存的地址映射和替换算法
cache – 主存的地址映射和替换算法映射(3)1.直接映射原理主存块以cache长度分区,映射时cache缓存块仅接受各区中相对应的块号,tag仅需保存t位区号eg: cache[0] 中仅可以存放 主存[0,2c,2c+1,3*2c…]每个缓存块i(cache) 可以和 若干个主存块对应每个主存块j只能和 一个 缓存块(cache)对应地址块号直接与cache对应块标记...原创 2019-04-10 20:15:23 · 1676 阅读 · 0 评论 -
190405_Py_practice_FOR_cycle
something interesting with ‘For cycle’ in pythonkey point : for_cycle & break & else#求100以内所有素数之和并输出。 ...原创 2019-04-05 12:50:41 · 64 阅读 · 0 评论 -
190404_py_practice_skill
#prog4#"水仙花数"是指一个三位整数,其各位数字的3次方和等于该数本身。#例如:ABC是一个"3位水仙花数",则:A的3次方+B的3次方+C的3次方 = ABC。...原创 2019-04-04 17:23:21 · 74 阅读 · 0 评论 -
Prog/Algo_practice_190401
Program/Algorithm_practice 1利用 二分法/dynamic array 实现子列最大和问题//FUNC1//output is only three states : left(A);mid(B);right(C)int max3(int A, int B, int C){ return A>B?A>C?A:C:B>C?B:C;}//find...原创 2019-04-03 17:13:52 · 129 阅读 · 0 评论 -
Struct_Practice_TREE
Practice_TREEQuestion1post : 342651analysis:不知道node的具体顺序但结合 pre & in 可知左子树结点个数(green)及右子树结点个数(蓝)分而治之:实际后序操作:(current :1)树根至于最后对左子树(蓝)递归对右子树(绿)递归//已上图为例,当递归进行到对右子树的右子树调用时,//会出现n==0的...原创 2019-06-19 21:34:03 · 117 阅读 · 0 评论