trick
Daria·Saira
这个作者很懒,什么都没留下…
展开
-
190405_Py_practice_FOR_cycle
something interesting with ‘For cycle’ in python key point : for_cycle & break & else #求100以内所有素数之和并输出。 ...原创 2019-04-05 12:50:41 · 64 阅读 · 0 评论 -
Python_file_test7_190616
conclusion join : join() 方法用于将序列中的元素以指定的字符连接生成一个新的字符串。 str.join(sequence) #coding:utf-8 f=open("C:/Users/UMR/Desktop/123.txt","rt") lines=f.readlines()#test find read with the space ('\n') lines...原创 2019-06-15 21:30:36 · 156 阅读 · 0 评论 -
C_test8_190511
C_test8_190511 question 1 题目内容: 你的程序要读入一行文本,其中以空格分隔为若干个单词,以‘.’结束。你要输出这行文本中每个单词的长度。这里的单词与语言无关,可以包括各种符号,比如“it’s”算一个单词,长度为4。注意,行中可能出现连续的空格。 输入格式: 输入在一行中给出一行文本,以‘.’结束,结尾的句号不能计算在最后一个单词的长度内。 输出格式: 在一行中输出这...原创 2019-05-12 14:06:52 · 88 阅读 · 0 评论 -
C_Polynomial multiplication and addition_190509
Polynomial multiplication and addition – realize by C notice : complement the code mathematical model data struct struct polynode{ int coef;//系数 int expon;//指数 struct polynode *link;//point to ...原创 2019-05-09 21:02:23 · 205 阅读 · 0 评论 -
Python_something/just for fun
list indices must be integers or slices, not str 列表索引 必须是 整数 或 切片,而不是str aha ! eval() space for eval() official code inp2=input() print("just out put the input:\n",inp2) print("and this is type of...原创 2019-05-19 14:39:29 · 236 阅读 · 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 评论 -
190419_c_test6
/* 题目内容: 由于计算机内部表达方式的限制,浮点运算都有精度问题,为了得到高精度的计算结果,就需要自己设计实现方法。 (0,1)之间的任何浮点数都可以表达为两个正整数的商,为了表达这样两个数的商,可以将相除的结果以多个整数来表示,每个整数表示结果的一位。 即商的第一位用一个整数来表示,第二位用另一个整数来表示,以此类推,就可以输出一个高精度的除法结果了。 如16/19的结果0.8421052...原创 2019-04-19 13:13:23 · 160 阅读 · 0 评论 -
C_190418_array
C_190418_array error : variably modified at file scope help text 1 help text 2 1、#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_test5 program1 #计算任意个输入数字的乘积 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 input def 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 评论 -
Python_test8_Robust input_190617
conclusion complex()和complex(eval())之间的比较将能够排除非数字类型的输入。 注意:不能直接使用eval(),否则,用户可以通过输入表达式(如100**2)输入数字,与要求不同(在实际应用中带来安全隐患)。 高危函数eval() try - except / assert #coding:utf-8 ''' program2.数字的鲁棒输入 --------...原创 2019-06-17 18:53:00 · 184 阅读 · 1 评论