2022.11.29 开学倒计时67天
上午学不下去东西做了规划,
14:30-14:40补完了昨晚闭馆剩下的一条习题,
按计划14:40-15:40文学院教材(外国文学,20-25天读完),15:55-16:55文学院公开课《说文解字》(预计15天看完,附录音韵学需定夺),17:35-17:50名著-索福克勒斯悲剧
晚饭,19:10-20:10 python,20:10-20:50 leetcode
7-1
car = input('what kind of car do you need?:') print("let me see if i can find you a " + car)
7-2
num = input('how many people will you come?:') if int(num) > 8: print("no empty table") else: print("welcome")
7-3
num = input('input a number:') if (int(num) % 10) == 0: print("it's mutiple of 10") else: print("no")
7-4
topping = '' while topping != 'quit': topping = input('what you wanna add?:') if topping == 'quit': print('end') else: print('we will add: ' + topping)
7-5
age = '' flag = True while age != 'quit': age = input('how old are you?:') if age == 'quit': flag = False if flag == False: print('end') else: age = int(age) if age < 3: print('you are free') elif ((age >= 3) & (age <= 12)): print('offer 10 dollar') elif age > 12: print('offer 15 dollar')
7-6
active = True age = '' while active == True: age = input('how old are you?:') if age == 'quit': active = False print('end') break else: age = int(age) if age < 3: print('you are free') elif ((age >= 3) & (age <= 12)): print('offer 10 dollar') elif age > 12: print('offer 15 dollar')
7-7
age = '' flag = True while age != 'quit': age = input('how old are you?:') if age == 'quit': flag = False while flag == True: age = int(age) if age < 3: print('you are free') elif ((age >= 3) & (age <= 12)): print('offer 10 dollar') elif age > 12: print('offer 15 dollar') if flag == False: print('end')
leetcode
2475. 数组中不等三元组的数目
暴力:
int unequalTriplets(int* nums, int numsSize){ int first,second,third; int num = 0; for(int i = 0; i < numsSize - 2; i++){ first = nums[i]; for(int j = i + 1; j < numsSize - 1; j++){ second = nums[j]; for(int k = j + 1; k < numsSize; k++){ third = nums[k]; if((first != second) && (second != third) && (first != third)){ num++; } } } } return num; }
还有个哈希表的写法,看了半个小时才看懂,明天试试看能不能复刻
标签:quit,21,int,age,num,print,input,Day From: https://www.cnblogs.com/IslandNeo/p/16935889.html